diff --git a/cogs/m10s_set_activity_roles.py b/cogs/m10s_set_activity_roles.py index d302d58..ac919ba 100644 --- a/cogs/m10s_set_activity_roles.py +++ b/cogs/m10s_set_activity_roles.py @@ -49,13 +49,13 @@ class m10s_act_role(commands.Cog): def __init__(self, bot): self.bot = bot self.cvtdict = { - "unknown":-1, - "playing":0, - "streaming":1, - "listening":2, - "watching":3, - "custom":4, - "competing":5 + -1:"unknown", + 0:"playing", + 1:"streaming", + 2:"listening", + 3:"watching", + 4:"custom", + 5:"competing" } @commands.hybrid_command(name="activity_role_setting", description="プレイ中ステータスに応じた役職付与を受け付けるかどうか") @@ -92,16 +92,16 @@ async def playing_roles(self, ctx, activity_type:int, role:Optional[discord.Role except: await ctx.send("> エラー\n アクティビティタイプが不明です。`s-help prole`を参考にしてください。") else: - rtn = await self.bot.cursor.fetchone("select * from activity_roles where guild_id = %s AND activity_type = %s", (ctx.guild.id,act_id)) + rtn = await self.bot.cursor.fetchone("select * from activity_roles where guild_id = %s AND activity_type = %s", (ctx.guild.id,activity_type)) # await self.bot.cursor.execute() if rtn: if role: - await self.bot.cursor.execute("UPDATE activity_roles SET role_id = %s WHERE guild_id = %s AND activity_type = %s",(role.id,ctx.guild.id,act_id)) + await self.bot.cursor.execute("UPDATE activity_roles SET role_id = %s WHERE guild_id = %s AND activity_type = %s",(role.id,ctx.guild.id,activity_type)) else: - await self.bot.cursor.execute("DELETE FROM activity_roles WHERE guild_id = %s AND activity_type = %s",(ctx.guild.id,act_id)) + await self.bot.cursor.execute("DELETE FROM activity_roles WHERE guild_id = %s AND activity_type = %s",(ctx.guild.id,activity_type)) else: if role: - await self.bot.cursor.execute("INSERT INTO activity_roles(guild_id,activity_type,role_id) VALUES(%s,%s,%s)",(ctx.guild.id,act_id,role.id)) + await self.bot.cursor.execute("INSERT INTO activity_roles(guild_id,activity_type,role_id) VALUES(%s,%s,%s)",(ctx.guild.id,activity_type,role.id)) try: await ctx.reply("> アクティビティロール\n 正常に登録/更新/削除が完了しました。") except: