#user id vs author id

1 messages · Page 1 of 1 (latest)

polar raven
#

when using ctx for interactions.ComponentContext and interactions.SlashContext whats the difference between ctx.user.id, ctx.author.id and ctx.author_id and which is the "correct" one to use?

fathom patioBOT
#

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

polar raven
#
    @interactions.slash_command(name="help")
    async def help(self, ctx: interactions.SlashContext):
        print(ctx.user.id)
        print(ctx.author.id)
        print(ctx.author_id)

prints out:

126814119281164288
126814119281164288
126814119281164288
untold bronze
#

it seems like... all of them are correct. 🤷

grand ravine
#

ctx.user is just the global user, whereas ctx.author can include per-server user info if this slash command is run in a server

#

examples include per-server avatar under ctx.author.display_avatar and the server object under ctx.author.guild