Add bot.py
This commit is contained in:
parent
08f3e0a32f
commit
c34291a001
1 changed files with 47 additions and 0 deletions
47
bot.py
Normal file
47
bot.py
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
import disnake
|
||||||
|
from disnake.ext import commands
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
from logger import Logger
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
logger = Logger('Melody\'s Servant')
|
||||||
|
TOKEN = os.getenv('BOT_TOKEN')
|
||||||
|
|
||||||
|
logger.info('Loading data...')
|
||||||
|
bot = commands.Bot(
|
||||||
|
command_prefix=['?'],
|
||||||
|
description='Bot Trigger',
|
||||||
|
owner_ids={169074240471957505, 1077069336415588362},
|
||||||
|
case_insensitive=True,
|
||||||
|
intents=disnake.Intents.all()
|
||||||
|
)
|
||||||
|
bot.remove_command('help')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@bot.event
|
||||||
|
async def on_ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@bot.event
|
||||||
|
async def on_message(message: disnake.Message):
|
||||||
|
if not message.author.bot:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@bot.event
|
||||||
|
async def on_error(event, *args, **kwargs):
|
||||||
|
with open('err.log', 'a', encoding='UTF-8') as f:
|
||||||
|
if event == 'on_message':
|
||||||
|
f.write(f'Unhandled message: {args[0]}\n')
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
bot.run(TOKEN, reconnect=True)
|
Loading…
Add table
Reference in a new issue