reaction-roles | bot Similar to the reaction roles discord bot | Bot library
kandi X-RAY | reaction-roles Summary
kandi X-RAY | reaction-roles Summary
An open source reaction roles bot to anyone who needs one in their server. It's easy to use, similar to the reaction roles bot and Totally Free. The bot also used MongoDB as a database!.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of reaction-roles
reaction-roles Key Features
reaction-roles Examples and Code Snippets
Community Discussions
Trending Discussions on reaction-roles
QUESTION
So basically, my bot comes with reaction roles and it works pretty efficiently by using partials. One of the checks before assigning the given role, Is to check whether the reaction role is reacted upon the msgID that I defined in my code. (This is useful for servers that have a channel like #reaction-roles and there is always 1 message that stays there for people to react with)
That is working fine. However, I was trying to do something new with my bot where I need the msgID to be saved (because the bot repeats the msg over and over to different people), however since the const of msgID is in the method called bot.on(message) I cannot access the const anywhere outside the method. Is there any way to get around this? Perhaps a way to temp store it in a config file?
...ANSWER
Answered 2020-Nov-21 at 17:50You can assign obj to const
variable outside the function and assign value to it inside the function and then you can access it outside the function as well.
Remember, when you assign object to a const
it is mutable in a sense that you can change its key/values but you cannot assign something else to this variable.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reaction-roles
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page