Skip to content

Commit

Permalink
There
Browse files Browse the repository at this point in the history
  • Loading branch information
JDJGInc authored Jan 14, 2024
1 parent bb3be4d commit d4fd43f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
8 changes: 6 additions & 2 deletions cogs/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,12 @@ async def token_snipper(self, ctx):
embed.set_image(url="https://i.imgur.com/WPExfNr.gif")
embed.set_footer(text="This snipper snipes tokens she sees in chat.")

view = utils.TokenInvalidatorSettings(ctx)
await ctx.send("Please pick the buttons below to pick.", embed=embed, view=view)
# view = utils.TokenInvalidatorSettings(ctx)
# await ctx.send("Please pick the buttons below to pick.", embed=embed, view=view)

await ctx.send("Going to change to a slash command with explict permissions for some options.")

# ie switches each context.

async def rtfm_lookup(self, url=None, *, args=None):
if not args:
Expand Down
38 changes: 0 additions & 38 deletions utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1669,44 +1669,6 @@ async def interaction_check(self, interaction: discord.Interaction):

return True


class TokenInvalidatorSettings(discord.ui.View):
def __init__(self, ctx, **kwargs):
super().__init__(**kwargs)
self.ctx = ctx

@discord.ui.button(label="DM ☑️", style=discord.ButtonStyle.success, emoji="📩", row=0)
async def dm_switch(self, interaction: discord.Interaction, button: discord.ui.Button):
await interaction.response.edit_message(content="DM Invalidation On", view=None, embed=None)

@discord.ui.button(label="Global ☑️", style=discord.ButtonStyle.success, emoji="<:_:411642484528119810>", row=0)
async def global_switch(self, interaction: discord.Interaction, button: discord.ui.Button):
await interaction.response.edit_message(content="Global Token Invalidator", view=None, embed=None)

@discord.ui.button(label="Guild ☑️", style=discord.ButtonStyle.success, emoji="<a:_:803876680166408192> ", row=0)
async def guild_switch(self, interaction: discord.Interaction, button: discord.ui.Button):
await interaction.response.edit_message(content="Guild Token Invalidator", view=None, embed=None)

@discord.ui.button(label="Channel ☑️", style=discord.ButtonStyle.success, emoji="<a:_:803876680166408192> ", row=0)
async def channel_switch(self, interaction: discord.Interaction, button: discord.ui.Button):
await interaction.response.edit_message(content="Channel Token Invalidator", view=None, embed=None)

async def interaction_check(self, interaction: discord.Interaction):
if self.ctx.author.id != interaction.user.id:
return await interaction.response.send_message(
content=f"You Can't Use that button, {self.ctx.author.mention} is the author of this message.",
ephemeral=True,
)

return True

async def on_timeout(self):
for item in self.children:
item.disabled = True

await self.view.message.edit(content="May want to start from the top", view=self)


# A Nitro Button Class(not actual nitro)


Expand Down

0 comments on commit d4fd43f

Please sign in to comment.