Browse Source

I am silly

Lucy 8 months ago
committed by GitHub
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 114 additions and 141 deletions
  1. +114

+ 114
- 141 View File

@ -1,141 +1,114 @@
# Komet-CL (Crash Landing)
Next-gen rewrite of Kurisu/Robocop/Komet bot used by AtlasNX, ReSwitched and Nintendo Homebrew with rewrite, designed to be relatively clean, consistent and un-bloated.
Code is based on and
## How to run
- Copy `` to ``, configure all necessary parts to your server.
- Install python3.6+.
- Install python dependencies (`pip3 install -Ur requirements.txt`, you might need to put `sudo -H` before that)
- If you're moving from Kurisu or Robocop: Follow `Tips for people moving from Kurisu/Robocop` below.
- Run `` (`python3`)
To keep the bot running, you might want to use pm2 or a systemd service.
## Tips for people moving from Kurisu/Robocop
If you're moving from Kurisu/Robocop, and want to preserve your data, you'll want to do the following steps:
- Copy your `data` folder over.
- Rename your `data/warnsv2.json` file to `data/userlog.json`.
- Edit `data/restrictions.json` and replace role names (`"Muted"` etc) with role IDs (`526500080879140874` etc). Make sure to have it as int, not as str (don't wrap role id with `"` or `'`).
All Robocop features are now supported.
<summary>List of added Kurisu/Robocop features</summary>
- [x] .py configs
- [x] membercount command
- [x] Meme commands and pegaswitch (honestly the easiest part)
- [x] source command
- [x] robocop command
- [x] Verification: Actual verification system
- [x] Verification: Reset command
- [x] Logging: joins
- [x] Logging: leaves
- [x] Logging: role changes
- [x] Logging: bans
- [x] Logging: kicks
- [x] Moderation: speak
- [x] Moderation: ban
- [x] Moderation: silentban
- [x] Moderation: kick
- [x] Moderation: userinfo
- [x] Moderation: approve-revoke (community)
- [x] Moderation: addhacker-removehacker (hacker)
- [x] Moderation: probate-unprobate (participant)
- [x] Moderation: lock-softlock-unlock (channel lockdown)
- [x] Moderation: mute-unmute
- [x] Moderation: playing
- [x] Moderation: botnickname
- [x] Moderation: nickname
- [x] Moderation: clear/purge
- [x] Moderation: restrictions (people who leave with muted role will get muted role on join)
- [x] Warns: warn
- [x] Warns: listwarns-listwarnsid
- [x] Warns: clearwarns-clearwarnsid
- [x] Warns: delwarnid-delwarn
- [x] .serr and .err (thanks tomger!)
The main goal of this project, to get Robocop functionality done, is complete.
Secondary goal is adding new features:
- [ ] New feature: Submiterr (relies on modmail)
- [ ] Feature creep: Shortlink completion (gl/ao/etc)
- [ ] New moderation feature: timelock (channel lockdown with time, relies on robocronp)
<summary>Completed features</summary>
- [x] Better security, better checks and better guild whitelisting
- [x] Feature creep: Reminds
- [x] A system for running jobs in background with an interval (will be called robocronp)
- [x] Commands to list said jobs and remove them
- [x] New moderation feature: timemute (mute with time, relies on robocronp)
- [x] New moderation feature: timeban (ban with expiry, relies on robocronp)
- [x] Improvements to lockdown to ensure that staff can talk
- [x] New moderation feature: Display of mutes, bans and kicks on listwarns (.userlog now)
- [x] New moderation feature: User notes
- [x] New moderation feature: Reaction removing features (thanks misson20000!)
- [x] New moderation feature: User nickname change
- [x] New moderation feature: watch-unwatch
- [x] New moderation feature: tracking suspicious keywords
- [x] New moderation feature: tracking invites posted
- [x] New self-moderation feature: .mywarns
- [x] New feature: Highlights (problematic words automatically get posted to modmail channel, relies on modmail)
- [x] Purge: On purge, send logs in form of txt file to server logs
- [x] New feature: Modmail
<summary>TODO for robocronp</summary>
- [ ] Reduce code repetition on
- [x] Allow non-hour values on timed bans
the following require me to rethink some of the lockdown code, which I don't feel like
- [ ] lockdown in helper
- [ ] timelock command
- [ ] working cronjob for unlock
## Credits
Robocop-NG is currently developed and maintained by @aveao and @tumGER. The official bot is hosted by @yuukieve.
I (ave) would like to thank the following, in no particular order:
- Ave, writing most code
- ReSwitched community, for being amazing
- ihaveamac/ihaveahax and f916253 for the original kurisu/robocop
- misson20000 for adding in reaction removal feature and putting up with my many BS requests on PR reviews
- Everyone who contributed to robocop-ng in any way (reporting a bug, sending a PR, forking and hosting their own at their own guild, etc).
import datetime
# Basic bot config, insert your token here, update description if you want
prefixes = [".", "!"]
token = "token-goes-here"
bot_description = "Robocop-NG, the moderation bot of ReSwitched."
# If you forked robocop-ng, put your repo here
source_url = ""
rules_url = ""
# The bot description to be used in .robocop embed
embed_desc = "Robocop-NG is developed by [Ave]("\
" and [tomGER](, and is a rewrite "\
"of Robocop.\nRobocop is based on Kurisu by 916253 and ihaveamac."
# Minimum account age required to join the guild
# If user's account creation is shorter than the time delta given here
# then user will be kicked and informed
min_age = datetime.timedelta(minutes=15)
# The bot will only work in these guilds
guild_whitelist = [
269333940928512010 # ReSwitched discord
# Role that gets chosen by default by .approve and .revoke if none was specified
default_named_role = "community"
# Named roles to be used with .approve and .revoke
# Example: .approve User hacker
named_roles = {
"community": 420010997877833731,
"hacker": 364508795038072833,
"participant": 434353085926866946
# The bot manager and staff roles
# Bot manager can run eval, exit and other destructive commands
# Staff can run administrative commands
bot_manager_role_id = 466447265863696394 # Bot management role in ReSwitched
staff_role_ids = [364647829248933888, # Team role in ReSwitched
360138431524765707, # Mod role in ReSwitched
466447265863696394, # Bot management role in ReSwitched
360138163156549632, # Admin role in ReSwitched
287289529986187266] # Wizard role in ReSwitched
# Various log channels used to log bot and guild's activity
# You can use same channel for multiple log types
# Spylog channel logs suspicious messages or messages by members under watch
# Invites created with .invite will direct to the welcome channel.
log_channel = 290958160414375946 # server-logs in ReSwitched
botlog_channel = 529070282409771048 # bot-logs channel in ReSwitched
modlog_channel = 542114169244221452 # mod-logs channel in ReSwitched
spylog_channel = 548304839294189579 # spy channel in ReSwitched
welcome_channel = 326416669058662401 # newcomers channel in ReSwitched
rules_channel = 567353505367719947 # rules channel in AtlasNX
support_faq_channel = 628596855470555167 # support-faq channel in AtlasNX
list_files_channel = 680792242188845079 # Used for uploading raw text files for list editing.
modmail_channel = 0 # Modlog channel in AtlasNX
# These channel entries are used to determine which roles will be given
# access when we unmute on them
general_channels = [420029476634886144,
539212260350885908] # Channels everyone can access
community_channels = [269333940928512010,
286612533757083648] # Channels requiring community role
# Channels that are lists that are controlled by the lists cog.
list_channels = [680129341958783086,
# Controls which roles are blocked during lockdown
lockdown_configs = {
# Used as a default value for channels without a config
"default": {
"channels": general_channels,
"roles": [named_roles["participant"]]
"community": {
"channels": community_channels,
"roles": [named_roles["community"], named_roles["hacker"]]
# The maximum amount of messages that can be purged before a sanity check is put in place
purge_warning_limit = 50
# Mute role is applied to users when they're muted
# As we no longer have mute role on ReSwitched, I set it to 0 here
mute_role = 0 # Mute role in ReSwitched
# Channels that will be cleaned every minute/hour
minutely_clean_channels = []
hourly_clean_channels = []
# Edited and deletes messages in these channels will be logged
spy_channels = general_channels
# Channels and roles where users can pin messages
allowed_pin_channels = []
allowed_pin_roles = []
# Used for the pinboard. Leave empty if you don't wish for a gist pinboard.
github_oauth_token = ""