Skip to content

Commit

Permalink
Role notifications made ephemeral and a short congratulations message…
Browse files Browse the repository at this point in the history
… added, in addition to the new public message.

This was overlooked in #121
  • Loading branch information
connorhsm committed Oct 21, 2023
1 parent a8b35ed commit c1d87d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dictator/cogs/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def ncl(self, interaction: discord.Interaction) -> None:
@app_commands.command()
async def exp(self, interaction: discord.Interaction) -> None:
"""Claims the EXP role if you have 50 or more hours in game. Grants you more access to the server."""
await interaction.response.defer()
await interaction.response.defer(ephemeral=True)

EXP_CHANNEL = self.dictator.get_channel(EXP_CHANNEL_ID)

Expand All @@ -67,11 +67,12 @@ async def exp(self, interaction: discord.Interaction) -> None:
await EXP_CHANNEL.send(
f'Congratulations, {interaction.user.mention}! You have claimed the \'{ROLE_2["name"]}\' role, for playing {ROLE_2["hours"]} or more hours in game! *Go take a break!*'
)
await interaction.followup.send(f"You now have the {ROLE_2['name']} role.")

@app_commands.command()
async def vet(self, interaction: discord.Interaction) -> None:
"""Claims the VET role if you have 375 or more hours in game. Grants you more access to the server."""
await interaction.response.defer()
await interaction.response.defer(ephemeral=True)

VET_CHANNEL = self.dictator.get_channel(VET_CHANNEL_ID)

Expand All @@ -93,11 +94,12 @@ async def vet(self, interaction: discord.Interaction) -> None:
await VET_CHANNEL.send(
f'Woah, {interaction.user.mention}! You have claimed the \'{ROLE_3["name"]}\' role, for playing {ROLE_3["hours"]} or more hours in game! *You\'re apart of the furniture now*'
)
await interaction.followup.send(f"You now have the {ROLE_3['name']} role.")

@app_commands.command()
async def wil(self, interaction: discord.Interaction) -> None:
"""Claims the WIL role if you have 1,000 or more hours in game. Grants you more access to the server."""
await interaction.response.defer()
await interaction.response.defer(ephemeral=True)

VET_CHANNEL = self.dictator.get_channel(VET_CHANNEL_ID)

Expand All @@ -119,6 +121,7 @@ async def wil(self, interaction: discord.Interaction) -> None:
await VET_CHANNEL.send(
f'Woah, {interaction.user.mention}! You have claimed the \'{ROLE_4["name"]}\' role, for playing {ROLE_4["hours"]} or more hours in game! *I suppose you can go now*'
)
await interaction.followup.send(f"You now have the {ROLE_4['name']} role.")

def already_has_role(self, interaction: discord.Interaction, role) -> bool:
role_object = discord.utils.get(interaction.user.roles, name=role)
Expand Down

0 comments on commit c1d87d4

Please sign in to comment.