-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc_bot.py
34 lines (26 loc) · 816 Bytes
/
dc_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
25
26
27
28
29
30
31
32
33
34
import discord
from typing import Final
import json
import os
from configs.configs import cred
import firebase_admin
firebase_admin.initialize_app(cred, {
'databaseURL': 'https://pinmarker-36552-default-rtdb.firebaseio.com/',
'storageBucket': 'pinmarker-36552.appspot.com'
})
intents = discord.Intents.default()
intents.message_content = True
bot = discord.Client(intents=intents)
# Helpers
from helpers.discord.message_handler import on_message_handler
from helpers.discord.ready_handler import on_ready_handler
with open('configs/discord.json', 'r') as config_file:
config = json.load(config_file)
TOKEN: Final = config['TOKEN']
@bot.event
async def on_ready():
await on_ready_handler(bot)
@bot.event
async def on_message(message):
await on_message_handler(bot, message)
bot.run(TOKEN)