An anti-toxicity Discord bot to ease moderation.
Palm uses the Perspective API to analyze messages and determine how likely they are to cause someone to leave a conversation. You can configure the bot to take action on unwanted messages, such as warning moderators (/config warn_mods
) or automatically deleting messages* (/config autodelete
).
Ensure you have an action enabled, such as warning moderators or autodeleting messages (read About).
Ensure Palm is permitted to send messages in the provided channel. You may have accidentally removed its permissions.
Perspective has a list of attributes that can be analyzed. Some are considered production attributes, meaning that they have been fully tested to provide accurate results. Some are marked as experimental, such as SEXUALLY_EXPLICIT
and FLIRTATION
. These attributes have not been tested as thoroughly, but should still work in most cases. Finally, some are marked as being for the New York Times (NYT). Since these attributes were made for the New York Times, they have only been trained on their data.
To make Palm easier to use, we removed some attributes that were either redundant or not applicable to Discord messages.
No. Palm cannot join nor listen to voice channels, nor can it scan the contents of images. For things like this, you're stuck with manual moderation.
Yes, but only things required to run the bot. Things such as message ids, channel ids, and configuration are all stored in Palm's database. Palm does not store any analytics, member names, nor the content of messages. Palm will never give third-party access to any of your information, even basic info. If you're still concerned, consider self-hosting Palm. That being said, the content of your messages is send to Perspective's API for analysis. Although Palm adds a "do-not-store" flag with your message, we cannot guarantee that Perspective will not store your messages.
- Install the latest version of node.js
- Install the MongoDB Community Server and ensure it's added to
PATH
- Rename
.env_template
to.env
, or duplicate the file and name it.env
- Create a Discord bot account (help)
- Copy your bot's token (under the Bot tab) and client id (under the OAuth2 tab) into the
.env
file - Enable the message content intent in the Bot tab
- Apply for a Perspective API token (further instructions)
- Enable the API, create an API key, and copy it into the
.env
file (further instructions) - Set the Mongo URI to the default
mongodb://127.0.0.1:27017
or a custom URI (if you set up one) - Before running the bot for the first time, run
npm run update
- To run the bot, open two terminals in your bot's directory. Run
mongod --dbpath ./db
in one andnpm run start
in the other - Return to your bot's page on the Discord Developer Portal and navigate to the URL Generator in the OAuth2 tab
- Select the
bot
andapplications.commands
scopes, then select the following bot permissions:- Read Messages/View Channels
- Send Messages
- Send Messages in Threads
- Manage Messages
- Copy the generated URL into your browser and invite the bot to your Discord server
- You now have your own self-hosted bot. To run it in the future, repeat step 11
For any questions regarding something about Perspective, visit their website.
For questions about the bot itself, ask in the official Palm Discord server. For any bugs/feature requests, create an issue.