#guild/command_error questions

1 messages · Page 1 of 1 (latest)

tropic ospreyBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

rustic turret
#

You can set it up in guild settings->integrations

#

In code you can do something like this, not sure if it's best solution

if SOME_ROLE_ID in ctx.author.roles:
solid gale
#

member.has_roles()

#

Not sure about the correct name of the function. But something like this

indigo snow
#

You can also use checks

#

Like @check(has_any_role(174918559539920897, 970018521511768094))

solid gale
#

how is guild defined?

#

get_guild is only for cached Guilds.
Your requested guild is not cached yet.
Try fetch_guild. Caution, this is async and has to be placed into an async function

serene dune
#

Easy way is to just move the definition of guild into on_startup and then change it to guild = await bot.fetch_guild(guild_id)

amber parrot
#

What do you expect to get from the function

#

Can you just read the docs?

#

the docs said that it is going to return a Member instance