2024-08-09 22:28:02 +01:00
|
|
|
"""
|
|
|
|
matchy.py - Discord bot that matches people into groups
|
|
|
|
"""
|
2024-08-08 23:32:52 +01:00
|
|
|
import logging
|
2024-08-09 22:28:02 +01:00
|
|
|
import discord
|
2024-08-13 20:12:48 +01:00
|
|
|
from discord.ext import commands
|
2024-08-14 16:55:23 +01:00
|
|
|
import os
|
2024-08-16 23:29:15 +01:00
|
|
|
import matchy.cogs.matcher
|
2024-08-14 22:42:53 +01:00
|
|
|
import matchy.cogs.owner
|
2024-08-10 10:06:13 +01:00
|
|
|
|
2024-08-08 23:32:52 +01:00
|
|
|
logger = logging.getLogger("matchy")
|
|
|
|
logger.setLevel(logging.INFO)
|
|
|
|
|
2024-08-07 22:15:39 +01:00
|
|
|
intents = discord.Intents.default()
|
|
|
|
intents.message_content = True
|
2024-08-07 23:23:52 +01:00
|
|
|
intents.members = True
|
2024-08-09 22:12:58 +01:00
|
|
|
bot = commands.Bot(command_prefix='$',
|
|
|
|
description="Matchy matches matchees", intents=intents)
|
|
|
|
|
2024-08-07 22:15:39 +01:00
|
|
|
|
2024-08-11 11:37:20 +01:00
|
|
|
@bot.event
|
|
|
|
async def setup_hook():
|
2024-08-17 14:58:19 +01:00
|
|
|
await bot.add_cog(matchy.cogs.matcher.MatcherCog(bot))
|
|
|
|
await bot.add_cog(matchy.cogs.owner.OwnerCog(bot))
|
2024-08-11 11:37:20 +01:00
|
|
|
|
|
|
|
|
2024-08-08 00:09:30 +01:00
|
|
|
@bot.event
|
|
|
|
async def on_ready():
|
2024-08-13 20:12:48 +01:00
|
|
|
logger.info("Logged in as %s", bot.user.name)
|
2024-08-07 23:23:52 +01:00
|
|
|
|
2024-08-09 22:12:58 +01:00
|
|
|
|
2024-08-09 23:14:42 +01:00
|
|
|
if __name__ == "__main__":
|
|
|
|
handler = logging.StreamHandler()
|
2024-08-14 16:55:23 +01:00
|
|
|
token = os.environ.get("TOKEN", None)
|
|
|
|
assert token, "$TOKEN required"
|
|
|
|
bot.run(token, log_handler=handler, root_logger=True)
|