-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
40 lines (28 loc) · 825 Bytes
/
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
import json
import discord
from bot import Bot
from config_loader import load_config, save_config
from poker import set_image_channel
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
bot_list = {}
@client.event
async def on_ready():
print(f'logged in as {client.user}')
load_config()
set_image_channel(client.get_channel(1148593469212860456))
@client.event
async def on_message(msg):
guild = msg.guild
if guild == None: # DM channel
return
if not guild.id in bot_list:
bot_list[guild.id] = Bot(guild)
if msg.content == '>>>save_config':
save_config()
await msg.channel.send("success")
return
await bot_list[guild.id].on_message(msg)
from bot_token import token
client.run(token)