Discord bot for Discord language servers (Python). Some key features:
- Extensive logging of joins, leaves, bans, deletes, edits, reaction removes, and invites that people use to join a server
- A smart message prune/clear command which takes a message ID as input so you don't have to count messages
- Configurable reaction requirement to enter a server
- Super watchlist for when you have raiders who are repeatedly making accounts and spamming gore/porn/etc.
- A questions module to manage the questions queue of a server. Mainly, for people who ask hard questions that get swept away in the channel, this module will help them make sure their question eventually gets answered.
- Options module for easy configuration of options
- Unlimited duration timed mutes and bans.
- Stats module for showing most active users in the server and per channel for the last month.
Bot is currently semi-private, message me on Discord if you want to use the bot (some users might be able to get an invite link by messaging ;invite to Rai)
First time setup guide can be found here: https://github.com/ryry013/Rai/wiki/First-time-setup
A guide on effective moderation is here: https://github.com/ryry013/Rai/wiki/How-to-use-Rai-to-moderate-effectively
Questions to my Discord account: Ryry013#9234
List of commands for Rai bot.
- General
- Admin
- Setting the mod/submod role and channel
- Setting a custom prefix
- Bans, mutes, warnings, and the modlog
- Captcha to enter a server
- Clear/prune messages
- Super_watch lists: an anti-raid tool
- Word filters for new users
- Antispam for message spam
- Antispam for image spam
- Stats
- Self-assignable roles
- Chinese server only commands
- Japanese server only commands
- Logging
- Japanese Study Commands
These are usable by anyone, mostly just for fun or light general utility.
;chlb (#other_channel_name)Shows the leaderboard for the current channel (or another channel if you specify one);eraserErases the last character of your nickname, supposedly a 📝, made in conjunction with ;pencil. Mostly a joke command;githubShows my GitHub page;inviteGives an invite to invite Rai to your server. Currently not everyone can use this command.;jisho <text>Links to a Jisho search of the text you cite. Useful for people who ask questions that could be answered with a simple jisho search.;lbShows the guild leaderboard.;nadeko_flip_testA command to simulate the Martingale strategy for Nadeko's coin flip gambling module (alias;nft);pingDoesn't actually perform a ping test but still a good test;pencilAdds a 📝 to the end of your name to signify that you wish to be corrected. See ;eraser;punchThe first command I made with cogs, just a test, try it;randomWalkGenerates a random walk plot, try it;ryanPosts an invite link to this page/my testing server;uShows your profile information
The commands in this module are only usable by users with either the Administrator privelege in a server, or if they have the mod role set in the next command. Most of these commands can be manipulated easier by typing ;options and using the menu that comes up.
Important messages from the bot will go here. This channel doesn't have to actually be your mod channel, just in the channel you want important notifications to go, type:
;set_mod_channelSets the current channel as the mod channel
;set_mod_role [role name]Sets the mod role for the server. Type the name of the role exactly in [role name].;set_submod_role [role name]If you want to optionally allow a secondary role to be able to mute users, use this. Otherwise,;mutewill default to the main mod role.
This is an optional feature. Submods can 1) ban users within one hour of them joining (for trolls spamming porn or something when there are no mods online), 2) mute users, 3) delete messages using a special command, and the log of the message will be left in the submod channel, and 4) pin messages using a special command.
;set_submod_channelSets the current channel as the submod channel
;set_submod_role [role name]Sets the mod role for the server. Type the name of the role exactly in [role name].
;set_prefix [prefix]Sets a custom prefix, for example,;set_prefix !<prefix>set_prefix resetResets the prefix to;
;modlog|warnlog [user]Views the modlog for a user. This contains all incidents of them being warned or muted, and is helpful for times when they ask "What did I do?!?!? You never warned me!!" Use silent warnings as a form of logging small incidents.;warnlog delete|del <user> <index>Deletes an entry from someone's warnlog. Index refers to the number in the list when you call their;warnlog. Example:;warnlog delete 202995638860906496 2.;warnlog edit|reason <user> <index> <reason>Edits the reason for an entry. Index refers to the number in the list when you call their;warnlog. You can also substitute;warnlog reason-->;reason. Example:;reason 202995638860906496 2 Trolling in voice.;ban [time] <user> [reason]Bans a user for an optional amount of time with an optional reason. Examples:;ban @Ryry013Bans me indefinitely.;ban 1d2h @Ryry013Bans me for 1 day and 2 hours.;ban @Ryry013 for being meanBans me indefinitely for being mean.
;mute [time] <user>Mutes a user from all text and voice chat. Similar usage to the above;bancommand.;warn [user] <reason> <-s>Warns a user and sends them a PM. Add-sinto the reason to make it not send the PM (makes it silent). Use this for either warning the user when they've done something, or use the silent warnings to log incidents
Sets up a requirement to react to a message with a checkmark to enter a server / get a role. Follow these steps:
- First, do
;captcha toggleto setup the module - Then, do
;captcha set_channelin the channel you want to activate it in. - Then, do
;captcha set_role <role name>to set the role you wish to add upon them captchaing. - Finally, do
;captcha post_messageto post the message people will react to.
;clear [number of messages] (user) (message_id) (aliases ;purge, ;prune) A clear/prune command with LOTS of different ways to use it. For a number of messages above 100, the bot will ask for a confirmation before starting the deleting.
The user field can be an ID, nickname, username, or mention. It will only delete messages from that user.
The message_id, if specified, will start a prune that deletes all messages past the specified message. See the following examples.
Typical usage:
;clear 50Clears the last 50 messages in the channel;clear 50 USER_IDIn the last 50 messages in the channel, deletes all messages from specified user.;clear 50 Ryry013You can also search by username/nickname. This is risky because the bot might find the wrong person.;clear 50 USER_ID MESSAGE_IDDeletes all messages from a specified user that also fall after the specified message (The bot will delete 50 messages or all messages below the specified message, whichever is less)
Special syntax:
;clear MESSAGE_IDA syntax where you only specify a message ID. It will default to a max of 100 messages at the most, and it will delete all messages from all users past the specified message id.
Super*watch
*(alias ;sw, ;superwatch)_
If you're being raided by someone who is repeatedly making multiple accounts to rejoin and spam, use this on the accounts that you think are the raiders. It will notify you every time they send a message, which obviously would normally be annoying, but it's helpful if you really do think they're a troll and you're just waiting for them to send their bad message, and you don't know where they'll send it to.
;super_watch add [id/name]Adds someone to the watch list. Every time they send a message anywhere, the bot will make a post notifying the mods.;sw remove [id/name]Removes someone from the watch list.;sw listShows the current list of super-watched people.;sw setSet the channel you wish the messages to be posted to
Super*voicewatch
*(aliases ;svw, ;supervoicewatch)_
If you've received reports for a user causing problems in voice, use this to notify the mods whenever that user joins voice so you can immediately go listen and hopefully confirm the reports.
;super_voicewatchSets-up the module/displays help for it.;svw add [USER];svw remove [USER]Adds/removes a user from the list;svw listShows a list of all users on the list currently
Type ;wordfilter to bring up a menu that will configure settings for punishments against new users who say some word or phrase you choose within their first minutes in the server. For example, you can set it to mute or ban users who say the n-word if it's their first five minutes in the server. The timing requirement allows you to be more strict in the filter compared to a normal user for which you wouldn't want to subject to the same strict filters.
Setup antispam to [mute/kick/ban] users who spam the same message [x] times in [y] seconds. For example, mute users who send the same message 10 times in 10 seconds. Type just ;antispam to enter the configuration menu.
Monitor image messages across multiple channels to detect and prevent spam, especially from compromised or hacked accounts. This module tracks how many images users send within a set timeframe, automatically times them out for 1 week, logs alerts with evidence, and bans them, providing instructions to appeal.
| Parameter | Description | Default |
|---|---|---|
channel |
Channel where image spam alerts will be sent | — |
limit |
Number of images required to trigger detection | 2 |
timeframe |
Time window (in seconds) to detect image spam | 10 |
Type /spam_enable to enable the image spam module, or /spam_disable to turn it off.
This command module has been deleted since the release of Discord's automod module. This is the list of filter terms I currently use for my servers from recent bot spammers.
Welcome new users when they join the server
;welcome_messageToggles the posting of welcome messages, while keeping the rest of the settings the same;welcome_message set_message <message>Sets the welcome message to whatever you put inside (without <>).;welcome_message set_channelSets the channel you send this command in to be the channel that welcome messages are posted into;welcome_message show_messageShows the currently set welcome message
Formatting variables: Put any of these in the welcome message to have them replaced with the relevant information in the actual welcome.
$NAME→ The name of the user (not a mention, just plaintext)$USERMENTION$→ A ping/mention to the user$SERVER$→ The name of the server
Will keep track of the top posters in a server, and also per channel. Give users their most-talked-in channels.
;statsEnable/disable the stats module;stats hideType this in your mod channels. It hides these channels from showing up in the;ucommand in public channels. Typing;uin one of the specified mod channels will include all the information for the mod channels.;u (member)Shows your profile information. Leave thememberfield blank to look up yourself.;lbShows the guild leaderboard.;chlb (#other_channel_name)Shows the leaderboard for the current channel (or another channel if you specify one);vc|v|vclb|vlb|voicechatLots of names for this command. Prints a leaderboard of who has the most time in voice.;uchannels|uc (member)Shows a full list of channel data for a user. Leave thememberfield blank to look up yourself.;albShows a leaderboard of user activity in the server. This is differnet from;lbin that it doesn't count just number of messages, but instead gives a user five activity points to the leaderboard for each new message in a unique channel every 60 seconds.;activityShows a graph of the user's activity per day over the last month.
Modeled after Nadeko's self-assignable role system. Allows users to assign themselves roless.
;asar <role_name>Assigns a self-assignable role.;lsar <page_number>Lists all self-assignable roles.;iam <role_name>Assign a role to yourself.;iamnott|iamn <role_name>Remove a role from yourself.
;hardcorePosts a message in that channel with a reaction for people to click to assign hardcore mode to themselves;hardcore ignoreAdds or removes a channel from the list of channels ignored by hardcore mode**;post_rules`** Updates the rules according to the Google Doc pinned in the mod channel.
;swapSwaps the names and positions of JHO and JHO2. Use this if JHO is particularly active and you want to move the welcome messages to JHO2. Or as a fun prank to confuse people.;ultrahardcore on(Japanese server only) (Alias:;uhc) Enters ultra hardcore mode, you must talk to a mod to remove it, which they can do by;uhc <user/id>.;ultrahardcore [NAME / ID]*(alias;uhc) *Removes a user from ultra hardcore mode;ultrahardcore ignoreAdds the channel that you send this message in to the whitelist for ignored channels for ultra hardcore mode.;uhc listLists the people in ultra hardcore mode.;uhc explanationPosts an explanation in English about hardcore mode to help explain to other people why you can't speak English if they don't understand your attempts to explain it to them in Japanese --;uhc lbShows a leaderboard of who has had UHC for the longest.
Part of the admin commands, but deserves it's own section.
There's a lot of logging that can be done, and the setup for all of them are pretty much all referring to the same code, so they're all the same.
The things you can log are:
- Deleted / edited messages (
;deletes,;edits) - Joins / leaves (
;welcomes/;joins,;leaves)- Detection of which invite link a user used to join the server (
;invites) - Readdition of roles to users who have left the server before and rejoin (
;readd_roles)
- Detection of which invite link a user used to join the server (
- Nickname / username changes (
;nicknames) - Deleted reactions (so users can't react an insult and then clear it) (
;reactions) - Kicks / bans (
;kicks,;bans)
To toggle a module, just type the module name with the command prefix (example: ;deletes)
To set the channel that the logging gets posted in, type the name of the module, then "set" (example: ;deletes set)
For examples/screenshots of all the loggings, try it yourself or see my testing server. ⠀
The questions module has been replaced by Discord's forum feature.
I have various commands that I've built over time to help Japanese studiers:
-
;g <text>Searches popular grammar sites like Tae Kim and Imabi for grammar points. -
;se <text>Searches Japanese Stackexchange for your text. Useful for more advanced questions or detailed "difference" answers. -
;neko <text>Searches the grammar database at Itazuraneko. -
;bunpro/bp <text>Searches the grammar database at bunpro. -
;massif <text>Searches the sentences at massif.la -
;yourei <text>Searches the sentences at yourei.jp -
;jisho <text>Gives a link to Jisho for a word. Helpful for people who say "what does X mean" and you want to teach them how to fish. -
;diff <word1> <word2>Gives google search results which will probably show the difference between two words you input. This literally just does a Google search so use it for people who ask the question "what's the difference between X and Y", and encourage them to do their own Google searches in the future before coming to ask the simple question. -
;sc <word1> <word2> ...Does a search compare lookup for two or more exact phrases and tells you the number of hits from different websites.