-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
60 lines (53 loc) · 1.72 KB
/
Copy pathmain.py
File metadata and controls
60 lines (53 loc) · 1.72 KB
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
56
57
58
59
60
import os
import disnake
from disnake.ext import commands
import sqlite3
from economy.economy import Economy
intents = disnake.Intents.default()
intents.message_content = True
intents.members = True
command_sync_flags = commands.CommandSyncFlags.default()
command_sync_flags.sync_commands_debug = True
bot = commands.Bot(command_prefix="l!", intents=intents)
bot.channel_conversations = {}
def setup_database():
"""Initialize the SQLite database for user memory."""
bot.conn = sqlite3.connect("user_memory.db")
bot.cursor = bot.conn.cursor()
bot.cursor.execute("""
CREATE TABLE IF NOT EXISTS user_memory (
user_id INTEGER PRIMARY KEY,
name TEXT,
info TEXT
)
""")
bot.conn.commit()
bot.setup_database = setup_database
bot.setup_database()
bot.economy = Economy()
@bot.event
async def on_ready():
print(f'Logged in as {bot.user}')
await bot.change_presence(status=disnake.Status.idle, activity=disnake.Activity(type=disnake.ActivityType.playing, name="being devlopped", url="https://aferiad-kamal.pages.dev/"))
files = {
"fun": [
"cat", "coin_flip", "dice", "greetings", "joke", "match"
],
"ai": [
"image-gen", "text-gen"
],
"events": [
"welcome"
],
"economy": [
"balance", "daily", "leaderboard", "message_listener", "gambling", "pay"
],
"moderation": [
"ban", "clear", "kick", "mute", "clone", "verify", "reactrole"
]
}
for folder in files:
for file in files[folder]:
bot.load_extension(f"{folder}.{file}")
# await bot._sync_application_commands()
bot.run(os.environ["TOKEN"])