From a7e7c5528494130aad1eeebb5699f93349981a41 Mon Sep 17 00:00:00 2001 From: HETHAT Date: Sun, 9 Jul 2023 17:13:42 +0100 Subject: [PATCH 1/2] Fix migrations --- .../migrations/{000_migrations.sql => 000_up__migrations.sql} | 0 cli.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename bot/models/migrations/{000_migrations.sql => 000_up__migrations.sql} (100%) diff --git a/bot/models/migrations/000_migrations.sql b/bot/models/migrations/000_up__migrations.sql similarity index 100% rename from bot/models/migrations/000_migrations.sql rename to bot/models/migrations/000_up__migrations.sql diff --git a/cli.py b/cli.py index dac4cc59..e3d101c8 100644 --- a/cli.py +++ b/cli.py @@ -150,7 +150,7 @@ async def main(ctx): await bot.start(settings.bot.token) -async def run_migration(file: str = "000_migrations.sql") -> Migration: +async def run_migration(file: str = "000_up__migrations.sql") -> Migration: with open(MIGRATIONS_PATH / file) as f: query = f.read() From 8f84a00041cf0554dd07d7bf008d87e70eb0672f Mon Sep 17 00:00:00 2001 From: Yinuo Huang <66022611+SnowballSH@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:15:56 +0800 Subject: [PATCH 2/2] Fix Challenge bug - Give user Participant instead of Submitted role on reaction --- bot/extensions/challenges/events.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/extensions/challenges/events.py b/bot/extensions/challenges/events.py index bb89be61..b88431ae 100644 --- a/bot/extensions/challenges/events.py +++ b/bot/extensions/challenges/events.py @@ -21,6 +21,10 @@ def __init__(self, bot: core.DiscordBot): def submitted_role(self) -> discord.Role | None: return self.bot.guild.get_role(settings.challenges.submitted_role_id) + @property + def participant_role(self) -> discord.Role | None: + return self.bot.guild.get_role(settings.challenges.participant_role_id) + @commands.Cog.listener() async def on_message(self, message: discord.Message): """Automatically react to new challenges.""" @@ -42,5 +46,5 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent): return await self.bot.http.add_role( - guild_id=self.bot.guild.id, user_id=payload.user_id, role_id=self.submitted_role.id + guild_id=self.bot.guild.id, user_id=payload.user_id, role_id=self.participant_role.id )