-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.py
24 lines (16 loc) · 841 Bytes
/
bot.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
import discord,sqlite3
from discord.ext import commands
from config import PREFIX, DATABASE_NAME, TOKEN
from os import environ, listdir
intents = discord.Intents.all()
conn = sqlite3.connect(DATABASE_NAME)
c = conn.cursor()
c.execute("CREATE TABLE IF NOT EXISTS users(guild_id TEXT, id TEXT, message_id TEXT, ip TEXT, task TEXT)")
c.execute("CREATE TABLE IF NOT EXISTS voice(guild_id TEXT, ip TEXT, category BIGINT, task TEXT)")
c.execute("CREATE TABLE IF NOT EXISTS log(guild_id TEXT, channel_id INTEGER)")
c.execute("CREATE TABLE IF NOT EXISTS timezone(guild_id TEXT, time TEXT)")
client = commands.Bot(command_prefix = PREFIX, intents = intents)
client.remove_command('help')
for cog in filter(lambda x: x.endswith(".py"), listdir("Cogs/")):
client.load_extension(f"Cogs.{cog[:-3]}")
client.run(TOKEN)