#Get User Object from UserID
1 messages · Page 1 of 1 (latest)
no
USER_ID is a constant, is that what you intended or not
there is just text highlight on interactions.get that says:
Cannot find reference 'get' in '__init__.py'
interactions.get()
Usage:
# Getting Channel, Guild or User
channel = await interactions.get(bot, interactions.Channel, object_id=CHANNEL_ID)
guild = await interactions.get(bot, interactions.Guild, object_id=GUILD_ID)
user = await interactions.get(bot, interactions.User, object_id=USER_ID)
# Getting Member, Role, Emoji or Message
member = await interactions.get(bot, interactions.Member, object_id=USER_ID, parent_id=GUILD_ID)
role = await interactions.get(bot, interactions.Role, object_id=ROLE_ID, parent_id=GUILD_ID)
emoji = await interactions.get(bot, interactions.Emoji, object_id=EMOJI_ID, parent_id=GUILD_ID)
message = await interactions.get(bot, interactions.Message, object_id=MESSAGE_ID, parent_id=CHANNEL_ID)
Arguments:
First argument is your interactions.Client instance
Second argument is the object you want to get
object_id is your object id
parent_id is usually guild id or channel id (for message). It is optional and needed for certain objects like Member, Role, etc.
can you pip freeze
self.client.get_user()
is there a way to get the role from the role_id?
Would you believe it's guild.get_role(id)?