reaction-light | Easy to use reaction role Discord bot written in Python | Bot library
kandi X-RAY | reaction-light Summary
kandi X-RAY | reaction-light Summary
Light yet powerful reaction role bot coded in Python.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create new reaction role
- Get channel by id
- Get the admins of a guild
- Check if a member is an administrator
- Edit channel selection
- Return a formatted list of reaction roles
- Return all the messages in a channel
- Clears the database
- Add a cleanup to the cleanup_queue
- Handles the message
- Checks to see if we have unreachable groups
- Update the database
- Toggle notification for a guild
- Check database version
- Print the latest version
- Send a notification to github
- Remove system channel
- Restart the server
- Check if the given version is newer than the current one
- Remove a guild from the database
- Change activity
- Edit a reaction
- Handle a reaction event
- Set the system channel
- Handle an admin action
- Removes a reaction
reaction-light Key Features
reaction-light Examples and Code Snippets
Community Discussions
Trending Discussions on reaction-light
QUESTION
So while we're all I'm surely aware of the entire copy and paste someone elses code, and magically it works, it looses some context and understanding when figuring out how this code actually works and functions.
I'm working with the Discord.py Rewrite, and a chunk of code called Reaction Light in order to create a bot that allows for self-assigning roles in my Discord Server. The bot is 100% functional and works as intended. Now, I have changed some things around from their code, so my methods are in different locations and are called from different areas.
Here's where I'm confused:
I have a method called isadmin()
this is called whenever there needs to be a check completed to figure out if the user issuing the command is an admin. Admin roles are defined in the .env file which I'm retrieving using the dotenv module. Pretty straight forward stuff. (I'll rewrite that portion of it later and hopefully put all the admin role id's into a file and grab them from there.) However I'm confused on what exactly the third argument of this method does. msg=False
Whenever I wrote my cogs for this I'm calling this method as such without passing that 'msg' argument to it as illustrated below:
...ANSWER
Answered 2020-Mar-05 at 12:57To be entirely honest I'm not sure why that's there. If you have access to ctx.author
you have access to ctx.message
as ctx.author
is simply the author of that message, seems redundent. However I strongly suggest you use checks for this. For example I have:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reaction-light
Run setup.py and follow the instructions or create a config.ini file (example provided in config.ini.sample) or edit it manually Insert the token of your bot (found at: https://discord.com/developers/applications/) You can set most of the other values via commands later (set manually name and logo, which appear in the footer of each embed)
Activate the message content intent for your bot (found at: https://discord.com/developers/applications/ under the bot section)
Invite the bot to your server(s) with enough permissions using the following link (need to replace CLIENT_ID with your bot's ID, visible under the general information tab):
On your Discord server, go to: Server Settings > Roles and move Reaction Light (or your bot's name) in a position that is above all roles that it needs to add/remove. The bot only has permission to manage the roles below its own role.
Run /admin add @Role to give users with that role permission to create reaction-role messages (even administrators need it). You need to be a server administrator to use this command.
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