Compare commits
2 commits
8f74565abd
...
2b8d0a6b15
Author | SHA1 | Date | |
---|---|---|---|
2b8d0a6b15 | |||
aad869cd5f |
1 changed files with 11 additions and 0 deletions
11
main.py
11
main.py
|
@ -1,6 +1,13 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import utils.data as data
|
import utils.data as data
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger('discord')
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
|
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
|
||||||
|
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
|
||||||
|
logger.addHandler(handler)
|
||||||
|
|
||||||
CONFIG = data.load_json("config")
|
CONFIG = data.load_json("config")
|
||||||
|
|
||||||
|
@ -15,4 +22,8 @@ cogs_list = [
|
||||||
for cog in cogs_list:
|
for cog in cogs_list:
|
||||||
bot.load_extension(f'cogs.{cog}')
|
bot.load_extension(f'cogs.{cog}')
|
||||||
|
|
||||||
|
@bot.listen('on_interaction')
|
||||||
|
async def statistics(interaction):
|
||||||
|
logger.info(f"{interaction.user} ({interaction.user.id}) used command {interaction.data['name']}.")
|
||||||
|
|
||||||
bot.run(CONFIG["token"])
|
bot.run(CONFIG["token"])
|
||||||
|
|
Loading…
Reference in a new issue