Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self service roles for Webgroup and Games (reaction/slash command) #13

Closed
DistroByte opened this issue Jan 28, 2024 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@DistroByte
Copy link
Member

No description provided.

@DistroByte DistroByte converted this from a draft issue Jan 28, 2024
@koyakonsta
Copy link
Member

koyakonsta commented Jan 29, 2024

penny for your thoughts ^_^. idk man i didn't do interactions.py. - xoreax

`

import interactions as discord

class Gib(discord.Extension):
    gib_choices=[ 
        discord.SlashCommandChoice(name="Webgroup", value="1166751688598761583"), # webgroup ID
        discord.SlashCommandChoice(name="gamz", value="1089204642241581139") ] # gamz ID
    roleoption = discord.slash_option(
        name="role", required=True, opt_type=discord.OptionType.STRING,choices=gib_choices)
    
    @discord.slash_command("gib", "Gib user a role")
    @roleoption
    async def gib_role(self, ctx: discord.SlashContext, role):
        ctx.author.add_role(role)
        await ctx.send(f"Done! Given you {role}")
    
    @discord.slash_command("ungib", "unGib user a role")
    @roleoption
    async def ungib_role(self, ctx: discord.SlashContext, role):
        ctx.author.remove_role(role)
        await ctx.send(f"Done! Removed {role}")`

@JedHazaymeh
Copy link
Contributor

Closed by #25

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ❌ Cancelled in Webgroup Jan 31, 2024
@JedHazaymeh JedHazaymeh moved this from ❌ Cancelled to 🚀 Deployed in Webgroup Jan 31, 2024
@JedHazaymeh JedHazaymeh added the enhancement New feature or request label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🚀 Deployed
Development

Successfully merging a pull request may close this issue.

3 participants