-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
51 lines (39 loc) · 1.21 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import configparser as cp
import sqlite3 as sql
from os.path import exists
import interactions as i
config = cp.ConfigParser()
config.read("config.ini")
bot = i.Client(token=config["General"]["token"],
disable_dm_commands=True,
intents=i.Intents.DEFAULT | i.Intents.MESSAGE_CONTENT)
if config["General"]["sentry_token"] != "":
bot.load_extension("interactions.ext.sentry",
token=config["General"]["sentry_token"])
bot.load_extension("interactions.ext.jurigged")
def setup_save():
if not exists("data.json"):
with open("data.json", "w") as f:
f.write("{}")
con = sql.connect("data.db")
cur = con.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS roles (
role_id INTEGER PRIMARY KEY,
name TEXT,
short_description TEXT,
long_description TEXT,
enabled BOOLEAN
)""")
setup_save()
@i.listen()
async def on_startup():
print("Bot started.")
bot.load_extension("extensions.application")
bot.load_extension("extensions.mod")
@i.slash_command(
name="test",
description="A test command to test stuff.",
)
async def test(ctx: i.SlashContext):
await ctx.send("Test worked!")
bot.start()