update
This commit is contained in:
parent
dfff67f0e7
commit
b331e6a38e
2 changed files with 7 additions and 7 deletions
|
@ -8,7 +8,7 @@ from urllib.parse import urlparse
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class RoleView(nextcord.ui.View):
|
class RoleView(nextcord.ui.View):
|
||||||
def __init__(self,bot,guild):
|
def __init__(self,bot: commands.bot):
|
||||||
super().__init__(timeout=None)
|
super().__init__(timeout=None)
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ class speechbubble(commands.Cog):
|
||||||
description="check if the buttons work",
|
description="check if the buttons work",
|
||||||
)
|
)
|
||||||
async def roletest(self, interaction: nextcord.Interaction, victim: nextcord.Member = nextcord.SlashOption(name="victim")):
|
async def roletest(self, interaction: nextcord.Interaction, victim: nextcord.Member = nextcord.SlashOption(name="victim")):
|
||||||
await interaction.response.send_modal(view=RoleView(self.bot,interaction.guild))
|
self.bot.roleguild = interaction.guild
|
||||||
|
await interaction.response.send_modal(view=RoleView())
|
||||||
|
|
||||||
def setup(bot: commands.Bot):
|
def setup(bot: commands.Bot):
|
||||||
bot.add_cog(rolebuttons(bot))
|
bot.add_cog(rolebuttons(bot))
|
|
@ -9,7 +9,7 @@ import os
|
||||||
|
|
||||||
|
|
||||||
class ApplicationView(nextcord.ui.View):
|
class ApplicationView(nextcord.ui.View):
|
||||||
def __init__(self,bot):
|
def __init__(self,bot: commands.Bot):
|
||||||
super().__init__(timeout=None)
|
super().__init__(timeout=None)
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
|
@ -53,9 +53,8 @@ class ApplicationView(nextcord.ui.View):
|
||||||
return
|
return
|
||||||
|
|
||||||
class ApplicationModal(nextcord.ui.Modal):
|
class ApplicationModal(nextcord.ui.Modal):
|
||||||
def __init__(self,user,bot):
|
def __init__(self,user):
|
||||||
self.victim = user
|
self.victim = user
|
||||||
self.bot = bot
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
f"create a speechbubble for {user.name}"
|
f"create a speechbubble for {user.name}"
|
||||||
)
|
)
|
||||||
|
@ -107,7 +106,7 @@ class ApplicationModal(nextcord.ui.Modal):
|
||||||
value=self.chance.value,
|
value=self.chance.value,
|
||||||
inline=False,
|
inline=False,
|
||||||
)
|
)
|
||||||
await interaction.send(f"<@{self.victim.id}> {interaction.user.name} proposes the following speech bubble for you:", embed=embed, view=ApplicationView(self.bot))
|
await interaction.send(f"<@{self.victim.id}> {interaction.user.name} proposes the following speech bubble for you:", embed=embed, view=ApplicationView())
|
||||||
|
|
||||||
|
|
||||||
class speechbubble(commands.Cog):
|
class speechbubble(commands.Cog):
|
||||||
|
|
Loading…
Reference in a new issue