#Gettin ctx.author by using buttons
1 messages · Page 1 of 1 (latest)
You can pass the author as a parameter to your view class and assign it to self
I tried that
interaction.user
In your callback you receive a discord.Interaction
.rtfm Interaction
discord.AutocompleteContext.interaction
discord.Bot.on_interaction
discord.AutoShardedBot.on_interaction
discord.MemberCacheFlags.interaction
discord.PublicUserFlags.bot_http_interactions
discord.UserFlags.bot_http_interactions
discord.InteractionType
discord.InteractionType.ping
discord.InteractionType.component
discord.InteractionType.auto_complete
discord.InteractionType.modal_submit
discord.InteractionResponseType
discord.InteractionResponseType.pong
discord.InteractionResponseType.channel_message
discord.InteractionResponseType.deferred_channel_message
discord.InteractionResponseType.deferred_message_update
discord.InteractionResponseType.message_update
discord.InteractionResponseType.auto_complete_result
discord.InteractionResponseType.modal
discord.on_interaction
discord.AutocompleteContext.interaction
discord.MemberCacheFlags.interaction
discord.InteractionType
discord.InteractionType.ping
discord.InteractionType.component
discord.InteractionType.auto_complete
discord.InteractionType.modal_submit
discord.InteractionResponseType
discord.InteractionResponseType.pong
discord.InteractionResponseType.channel_message
discord.InteractionResponseType.deferred_channel_message
discord.InteractionResponseType.deferred_message_update
discord.InteractionResponseType.message_update
discord.InteractionResponseType.auto_complete_result
discord.InteractionResponseType.modal
discord.InteractionResponded
discord.InteractionResponded.args
discord.InteractionResponded.with_traceback
discord.Message.interaction
discord.Interaction
just take his word
Last one
.rtfm interaction.user
:)
Why doesn't the search prioritize exact matches anyways?
because I coded it
I see
and there was a priority to just at least get it working
what's the issue if any?
First of all, never manually insert values to an SQL query through f strings, that's an SQL injection waiting to happen
second, you're trying to set player to a user object
what should I do?
player is a column
Use query parameters
https://stackoverflow.com/questions/228912/sqlite-parameter-substitution-problem
And wouldn't it make more sense to use their ID? What if the user changes their name?
or their nitro expires
Or they buy nitro
or like 500 more other reasons on why their name/discriminator changes
And currently, if their name is "; DROP TABLE game;-- your entire table is going to be deleted 
That isn't an excuse to be doing bad practices
#general message
always use SQL parameters no matter what
and i don't know how to keep my database safe so i will keep it anyway
ok
I'll do it
but I thank you right away because the bot is working
I already changed it
I just held a presentation about SQL injections and XSS for my colleagues last week, hopefully they learn as quickly as you do lol
You should use ids for anything when working with a database.
Like Spaxter said, they could change their name, you can’t change your ID.
Like said, there are a million ways their name/discriminator could change, so using IDs is a lot better
your Discord ID can also change because Ian Deploy
your English was fluent
.close
Done with your help thread?
Please close your own help thread by using </close:1009144375709814897> with @vernal geyser.
