diff --git a/christmas_cog.py b/christmas_cog.py new file mode 100644 index 0000000000000000000000000000000000000000..88c6927489bee704fdb87446cf621614e96e925a --- /dev/null +++ b/christmas_cog.py @@ -0,0 +1,22 @@ +import os + +from discord.ext import commands + +import utils + + +class ChristmasCog(commands.Cog): + def __init__(self, bot): + self.bot = bot + self.channel_id = int(os.getenv("DISCORD_ADVENT_CALENDAR_CHANNEL")) + + @commands.command("story") + @commands.check(utils.is_mod) + async def cmd_update_welcome(self, ctx, *args): + channel = await self.bot.fetch_channel(self.channel_id) + message = f"Einreichung von <@!{ctx.author.id}>:\n" + + for arg in args: + message += f"{arg} " + + await channel.send(message) diff --git a/fernuni_bot.py b/fernuni_bot.py index 1a7c93b909e2ca69c84bae60e8a5a7ba494267ba..743d4a48904b050fe92d4129b68773a83355397b 100644 --- a/fernuni_bot.py +++ b/fernuni_bot.py @@ -8,6 +8,7 @@ from dotenv import load_dotenv # from welcome_cog import WelcomeCog import utils from appointments_cog import AppointmentsCog +from christmas_cog import ChristmasCog from poll_cog import PollCog from roles_cog import RolesCog from text_commands_cog import TextCommandsCog @@ -34,12 +35,14 @@ text_commands_cog = TextCommandsCog(bot) tops_cog = TopsCog(bot) roles_cog = RolesCog(bot) welcome_cog = WelcomeCog(bot) +christmas_cog = ChristmasCog(bot) bot.add_cog(appointments_cog) bot.add_cog(text_commands_cog) bot.add_cog(poll_cog) bot.add_cog(tops_cog) bot.add_cog(roles_cog) bot.add_cog(welcome_cog) +bot.add_cog(christmas_cog) # bot.add_cog(welcome_cog)