-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
55 lines (32 loc) · 1.63 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
52
53
54
55
import disnake
from disnake.ext import commands
import os
import sqlite3
from decouple import config
BOT_TOKEN = config('BOT_TOKEN')
bot = commands.Bot(command_prefix='/', intents=disnake.Intents.all(), reload=True)
conn = sqlite3.connect('bans.db')
c = conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS bans
(user_id INTEGER PRIMARY KEY, username TEXT, reason TEXT)''')
c.execute('''CREATE TABLE IF NOT EXISTS economy
(user_id INTEGER PRIMARY KEY, username TEXT, balance INTEGER, last_daily INTEGER)''')
c.execute('''CREATE TABLE IF NOT EXISTS oilrigs
(oilrig_id INTEGER PRIMARY KEY, owner INTEGER, oilrig_lvl INTEGER, oilrig_oil INTEGER, oilrig_max INTEGER, oilrig_next_lvl_exp INTEGER, oilrig_exp INTEGER, condition INTEGER)''')
c.execute('''CREATE TABLE IF NOT EXISTS levels
(user_id INTEGER PRIMARY KEY, xp INTEGER, level INTEGER)''')
for filename in os.listdir(f'./cogs/'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{filename[:-3]}')
print(f"\033[38;5;38m[Polina] \033[38;5;67m⌗ COGS: \033[38;5;105m{filename[:-3]}\033[0;0m has been loaded")
else:
if filename != '__pycache__':
for file in os.listdir(f'cogs.{filename}/'):
if file.endswith('.py'):
bot.load_extension(f'cogs.{filename}.{file[:-3]}')
print(
f"\033[38;5;38m[Polina] \033[38;5;67m⌗ COGS: \033[38;5;105m{filename}.{file[:-3]}\033[0;0m has been loaded")
bot.event
async def on_disconnect():
conn.close()
bot.run(BOT_TOKEN)