diff --git a/rolebuttons.py b/rolebuttons.py index a095818..3a8d446 100644 --- a/rolebuttons.py +++ b/rolebuttons.py @@ -8,7 +8,7 @@ from urllib.parse import urlparse import os class RoleView(nextcord.ui.View): - def __init__(self,bot: commands.bot): + def __init__(self,bot): super().__init__(timeout=None) self.bot = bot @@ -25,7 +25,7 @@ class speechbubble(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot - bot.add_view(RoleView()) + bot.add_view(RoleView(bot)) @nextcord.slash_command( name="roletest", @@ -33,7 +33,7 @@ class speechbubble(commands.Cog): ) async def roletest(self, interaction: nextcord.Interaction, victim: nextcord.Member = nextcord.SlashOption(name="victim")): self.bot.roleguild = interaction.guild - await interaction.response.send_modal(view=RoleView()) + await interaction.response.send_modal(view=RoleView(self.bot)) def setup(bot: commands.Bot): bot.add_cog(rolebuttons(bot)) \ No newline at end of file diff --git a/speechbubble.py b/speechbubble.py index 5f3d602..c031f28 100644 --- a/speechbubble.py +++ b/speechbubble.py @@ -9,7 +9,7 @@ import os class ApplicationView(nextcord.ui.View): - def __init__(self,bot: commands.Bot): + def __init__(self,bot): super().__init__(timeout=None) self.bot = bot @@ -53,8 +53,9 @@ class ApplicationView(nextcord.ui.View): return class ApplicationModal(nextcord.ui.Modal): - def __init__(self,user): + def __init__(self,user,bot): self.victim = user + self.bot = bot super().__init__( f"create a speechbubble for {user.name}" ) @@ -106,14 +107,14 @@ class ApplicationModal(nextcord.ui.Modal): value=self.chance.value, inline=False, ) - await interaction.send(f"<@{self.victim.id}> {interaction.user.name} proposes the following speech bubble for you:", embed=embed, view=ApplicationView()) + await interaction.send(f"<@{self.victim.id}> {interaction.user.name} proposes the following speech bubble for you:", embed=embed, view=ApplicationView(self.bot)) class speechbubble(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot - bot.add_view(ApplicationView()) + bot.add_view(ApplicationView(bot)) @commands.Cog.listener('on_message') async def on_message(self,message):