Huge re-org to match normal python project structure
This commit is contained in:
parent
b263e20ca2
commit
92bc50396b
22 changed files with 35 additions and 47 deletions
40
matchy.py
Normal file
40
matchy.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""
|
||||
matchy.py - Discord bot that matches people into groups
|
||||
"""
|
||||
import logging
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
import os
|
||||
from matchy.files.state import load_from_file
|
||||
import matchy.cogs.matchy
|
||||
import matchy.cogs.owner
|
||||
|
||||
_STATE_FILE = ".matchy/state.json"
|
||||
state = load_from_file(_STATE_FILE)
|
||||
|
||||
logger = logging.getLogger("matchy")
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
intents.members = True
|
||||
bot = commands.Bot(command_prefix='$',
|
||||
description="Matchy matches matchees", intents=intents)
|
||||
|
||||
|
||||
@bot.event
|
||||
async def setup_hook():
|
||||
await bot.add_cog(matchy.cogs.matchy.Cog(bot, state))
|
||||
await bot.add_cog(matchy.cogs.owner.Cog(bot, state))
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
logger.info("Logged in as %s", bot.user.name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
handler = logging.StreamHandler()
|
||||
token = os.environ.get("TOKEN", None)
|
||||
assert token, "$TOKEN required"
|
||||
bot.run(token, log_handler=handler, root_logger=True)
|
Loading…
Add table
Add a link
Reference in a new issue