How do I let a bot recognize users? #1365
-
I would like to code some games for Discord Bots. for further explanation: I use lightbulb for hikari wich is for but not of hikari. So if a user types /use "something specific" I want the bot to automatically fetch that Users ID and check if the User has been registered, and then to react with I figured that I need to construct a User class that contains their User ID to recognize them but im quite new to For example there could be real time games like these old Browser Games with timers and set actions you need to confirm. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Something you can do is link a user ID to its "character" and store that information in a database. You can get the user that executed the interaction from the event that is received, and I'm sure lightbulb exports that in their context variable (iirc, its Hope that answers your question. If you have any follow-up ones, you can ask them here and I will try my best to answer or you can join our Discord server and ask there (https://discord.gg/hikari) :) |
Beta Was this translation helpful? Give feedback.
Something you can do is link a user ID to its "character" and store that information in a database. You can get the user that executed the interaction from the event that is received, and I'm sure lightbulb exports that in their context variable (iirc, its
ctx.author.id
).Hope that answers your question. If you have any follow-up ones, you can ask them here and I will try my best to answer or you can join our Discord server and ask there (https://discord.gg/hikari) :)