#Issue with Mentionables in a Slash_command Option()

1 messages · Page 1 of 1 (latest)

dense crown
#

Ok so I'm trying to take in a list of mentionables in an Option parameter. I'm doing this as a string, because I dont want to do multiple Options for this, and seemingly the only way to do it in one is to take it in as a string.

@bot.slash_command(guild_only=True,description="Host a giveaway!")
async def giveaway(
    ctx: discord.ApplicationContext,
    ....
    required_roles: Option(str, "Roles required to enter the giveaway", default='default'),
    winners: Option(int, "The number of winners to pick", min_value=1, default=1)
    ):
  
  print(str(required_roles)) # prints ''
  await ctx.send(required_roles) #sends the ping fine

So, I take in the mention as shown, however, when I try to print it nothing is printed. I am able to send it again into a discord channel, so I'm completely confused why it seems to have the value of a blank string when printed.

#

Just fixed it with:

  required_roles = required_roles.strip('<@&>')

Is this working right though, I don't see why it wouldnt print before?

calm fog
#

?tag close

dark hareBOT
#

dynoError No tag close found.

calm fog
#

.tag close

slate finchBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @full quartz.

Backup bot: </solved:1109625445990793246> (or .solved) with @slate finch.