C
C
curs3dcult2022-04-08 17:45:16
Python
curs3dcult, 2022-04-08 17:45:16

How to make an option to select? Example: you write gender and you have two options to choose from. Discord.py Discord_Slash. Also a description of the command. How?

@slash.slash(name="genderka")
async def genderka(ctx: SlashContext,member: discord.Member, gender):
    if gender == "male" or "Male":
        await member.add_roles(member.guild.get_role(здесь айдишка))
        await ctx.send(f'{member.mention} выдана роль {member.guild.get_role(здесь айдишка)}')
    elif gender == "female" or "Female":
        await member.add_roles(member.guild.get_role(здесь айдишка))
        await ctx.send(f'{member.mention} выдана роль {member.guild.get_role(здесь айдишка)}')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alan Gibizov, 2022-04-08
@phaggi

If you have such a construction in your code: it means you don’t know the simplest things, like solving linear equations with one variable from the 5th grade school course. With such knowledge, it’s obviously too early for you to deal with bots - it’s like a fourth-grader dealing with systems of equations with many variables. Too early.
if gender == "male" or "Male":

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question