Discord bot for handling Ryujinx moderation tasks and such, (n)ext-(g)en rewrite of Robocop
Find a file
2019-04-11 00:50:41 -04:00
cogs Adjust message as requested 2019-04-11 00:50:41 -04:00
helpers logs-spy: ignore messages by staff 2019-03-05 20:33:19 +03:00
.gitignore Get rid of data folder on git, add it to gitignore, gen files needed at 2018-12-27 14:13:28 +03:00
config_template.py update source_url 2019-03-11 16:19:18 +01:00
LICENSE Initial commit 2018-03-09 01:47:53 +03:00
README.md Various improvements 2019-03-02 21:00:55 +03:00
requirements.txt Implement gist-based pinboard - creates a gist for each channel that allows user pins 2019-03-03 14:29:46 +01:00
Robocop.py Embed messages that are spied on 2019-03-03 21:02:08 +03:00

Robocop-ng

Next-gen rewrite of Kurisu/Robocop bot used on ReSwitched bot with discord.py rewrite, designed to be relatively clean, consistent and un-bloated.

Code is based on https://gitlab.com/ao/dpybotbase and https://github.com/916253/Kurisu-Reswitched.


How to run

  • Copy config.py.template to config.py, 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 Robocop.py (python3 Robocop.py)

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 ').

TODO

All Robocop features are now supported.

List of added Kurisu/Robocop features

  • .py configs
  • membercount command
  • Meme commands and pegaswitch (honestly the easiest part)
  • source command
  • robocop command
  • Verification: Actual verification system
  • Verification: Reset command
  • Logging: joins
  • Logging: leaves
  • Logging: role changes
  • Logging: bans
  • Logging: kicks
  • Moderation: speak
  • Moderation: ban
  • Moderation: silentban
  • Moderation: kick
  • Moderation: userinfo
  • Moderation: approve-revoke (community)
  • Moderation: addhacker-removehacker (hacker)
  • Moderation: probate-unprobate (participant)
  • Moderation: lock-softlock-unlock (channel lockdown)
  • Moderation: mute-unmute
  • Moderation: playing
  • Moderation: botnickname
  • Moderation: nickname
  • Moderation: clear/purge
  • Moderation: restrictions (people who leave with muted role will get muted role on join)
  • Warns: warn
  • Warns: listwarns-listwarnsid
  • Warns: clearwarns-clearwarnsid
  • Warns: delwarnid-delwarn
  • .serr and .err (thanks tomger!)


The main goal of this project, to get Robocop functionality done, is complete.

Secondary goal is adding new features:

  • Purge: On purge, send logs in form of txt file to server logs
  • New verification feature: Using log module from akbbot for logging attempts and removing old attempts
  • New feature: Modmail
  • New feature: Submiterr (relies on modmail)
  • New feature: Highlights (problematic words automatically get posted to modmail channel, relies on modmail)
  • Feature creep: Shortlink completion (gl/ao/etc)
  • New moderation feature: timelock (channel lockdown with time, relies on robocronp)
Completed features

  • Better security, better checks and better guild whitelisting
  • Feature creep: Reminds
  • A system for running jobs in background with an interval (will be called robocronp)
  • Commands to list said jobs and remove them
  • New moderation feature: timemute (mute with time, relies on robocronp)
  • New moderation feature: timeban (ban with expiry, relies on robocronp)
  • Improvements to lockdown to ensure that staff can talk
  • New moderation feature: Display of mutes, bans and kicks on listwarns (.userlog now)
  • New moderation feature: User notes
  • New moderation feature: Reaction removing features (thanks misson20000!)
  • New moderation feature: User nickname change
  • New moderation feature: watch-unwatch
  • New moderation feature: tracking suspicious keywords
  • New moderation feature: tracking invites posted
  • New self-moderation feature: .mywarns

TODO for robocronp

  • Reduce code repetition on mod_timed.py
  • 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


Thanks to

  • ReSwitched community, for being amazing
  • ihaveamac/ihaveahax and f916253 for the original kurisu/robocop
  • tomGER for working hard on rewriting the .err/.serr commands, those were a nightmare
  • misson20000 for adding in reaction removal feature and putting up with my many BS requests on PR reviews