i have this discord bot button, but anyone can click this button, i just want the user…
- User
i have this discord bot button, but anyone can click this button, i just want the user that created the interaction to be able to click the button, how can i do it? class Button2(View): def init(self, bot, link, *args, **kwargs): super().init(*args, **kwargs, timeout=60) self.bot = bot self.link_url = link
@discord.ui.button(label="Bypass link", emoji="<:check:1157813295324069908>", style=discord.ButtonStyle.success, custom_id="prev") async def prev_button2(self, interaction: discord.Interaction, button: discord.ui.Button): try: await interaction.response.defer() embed = discord.Embed(title="<a:loading:1155221326420779042> Bypassing your link...", color=discord.Color.blurple()) await interaction.edit_original_response(embed=embed) await bypasser.bypass(self.bot, interaction, self.link_url) except Exception: traceback.print_exc() - Assistant
- User
why am getting this error? Traceback (most recent call last): File "/home/container/commands/🎉 - Fun/bypass.py", line 31, in bypass_command await bypasser.bypass(self, interaction, link_url=link) File "/home/container/src/utils/bypasser.py", line 101, in bypass await interaction.edit_original_response(embed=embed, view=bypass_button.Button2(bot, extracted_url, interaction.user.id)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: View.init() takes 1 positional argument but 4 were given
- Assistant