2020-04-20 21:56:34 +00:00
import hashlib
2018-12-23 19:03:40 +00:00
import datetime
2019-02-26 12:21:33 +00:00
# Basic bot config, insert your token here, update description if you want
2018-12-23 13:13:39 +00:00
prefixes = [ " . " , " ! " ]
token = " token-goes-here "
2019-01-07 08:49:19 +00:00
bot_description = " Robocop-NG, the moderation bot of ReSwitched. "
2018-12-23 17:27:51 +00:00
2019-02-26 12:21:33 +00:00
# If you forked robocop-ng, put your repo here
2019-03-11 15:19:18 +00:00
source_url = " https://github.com/reswitched/robocop-ng "
2021-07-15 11:38:18 +00:00
rules_url = " https://reswitched.github.io/discord/#rules "
2018-12-23 19:03:40 +00:00
2018-12-23 17:27:51 +00:00
# The bot description to be used in .robocop embed
2020-04-20 22:05:32 +00:00
embed_desc = (
" Robocop-NG is developed by [Ave](https://github.com/aveao) "
" and [tomGER](https://github.com/tumGER), and is a rewrite "
" of Robocop. \n Robocop is based on Kurisu by 916253 and ihaveamac. "
)
2018-12-23 17:27:51 +00:00
2018-12-23 19:03:40 +00:00
2020-04-20 21:42:49 +00:00
# The cogs the bot will load on startup.
2020-04-20 22:05:32 +00:00
initial_cogs = [
" cogs.common " ,
" cogs.admin " ,
" cogs.verification " ,
" cogs.mod " ,
" cogs.mod_note " ,
" cogs.mod_reacts " ,
" cogs.mod_userlog " ,
" cogs.mod_timed " ,
" cogs.mod_watch " ,
" cogs.basic " ,
" cogs.logs " ,
" cogs.err " ,
" cogs.lockdown " ,
" cogs.legacy " ,
" cogs.links " ,
" cogs.remind " ,
" cogs.robocronp " ,
" cogs.meme " ,
" cogs.invites " ,
2022-05-24 21:29:46 +00:00
" cogs.yubicootp " ,
2020-04-20 22:05:32 +00:00
]
2020-04-20 21:42:49 +00:00
# The following cogs are also available but aren't loaded by default:
# cogs.imagemanip - Adds a meme command called .cox.
# Requires Pillow to be installed with pip.
# cogs.lists - Allows managing list channels (rules, FAQ) easily through the bot
# PR'd in at: https://github.com/reswitched/robocop-ng/pull/65
# cogs.pin - Lets users pin important messages
# and sends pins above limit to a github gist
2020-04-08 15:27:05 +00:00
# The string that users need to say to get past verification
verification_string = " go read the rules, not the code "
2019-02-26 12:21:33 +00:00
# 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
2018-12-23 19:03:40 +00:00
min_age = datetime . timedelta ( minutes = 15 )
2019-02-26 12:21:33 +00:00
# The bot will only work in these guilds
2020-04-20 22:05:32 +00:00
guild_whitelist = [ 269333940928512010 ] # ReSwitched discord
2018-12-23 13:13:39 +00:00
2018-12-23 19:59:42 +00:00
# Named roles to be used with .approve and .revoke
2019-02-26 12:21:33 +00:00
# Example: .approve User hacker
2018-12-23 19:59:42 +00:00
named_roles = {
2019-02-26 12:21:33 +00:00
" community " : 420010997877833731 ,
" hacker " : 364508795038072833 ,
2020-04-20 22:05:32 +00:00
" participant " : 434353085926866946 ,
2018-12-23 19:59:42 +00:00
}
2019-02-26 12:21:33 +00:00
# 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
2020-04-20 22:05:32 +00:00
staff_role_ids = [
364647829248933888 , # Team role in ReSwitched
360138431524765707 , # Mod role in ReSwitched
466447265863696394 , # Bot management role in ReSwitched
360138163156549632 , # Admin role in ReSwitched
2020-04-20 22:17:20 +00:00
287289529986187266 , # Wizard role in ReSwitched
]
2018-12-23 15:44:16 +00:00
2019-02-26 12:21:33 +00:00
# Various log channels used to log bot and guild's activity
# You can use same channel for multiple log types
2019-02-26 13:11:06 +00:00
# Spylog channel logs suspicious messages or messages by members under watch
2019-03-02 23:40:43 +00:00
# Invites created with .invite will direct to the welcome channel.
2019-02-26 12:21:33 +00:00
log_channel = 290958160414375946 # server-logs in ReSwitched
botlog_channel = 529070282409771048 # bot-logs channel in ReSwitched
modlog_channel = 542114169244221452 # mod-logs channel in ReSwitched
2019-02-26 13:11:06 +00:00
spylog_channel = 548304839294189579 # spy channel in ReSwitched
2019-02-26 12:21:33 +00:00
welcome_channel = 326416669058662401 # newcomers channel in ReSwitched
2018-12-23 19:06:32 +00:00
2019-02-26 12:21:33 +00:00
# These channel entries are used to determine which roles will be given
# access when we unmute on them
2020-04-20 22:05:32 +00:00
general_channels = [
420029476634886144 ,
414949821003202562 ,
383368936466546698 ,
343244421044633602 ,
491316901692178432 ,
539212260350885908 ,
] # Channels everyone can access
community_channels = [
269333940928512010 ,
438839875970662400 ,
404722395845361668 ,
435687501068501002 ,
286612533757083648 ,
] # Channels requiring community role
2018-12-23 20:50:05 +00:00
2019-03-01 06:07:47 +00:00
# Controls which roles are blocked during lockdown
lockdown_configs = {
# Used as a default value for channels without a config
2020-04-20 22:05:32 +00:00
" default " : { " channels " : general_channels , " roles " : [ named_roles [ " participant " ] ] } ,
2019-03-01 06:07:47 +00:00
" community " : {
" channels " : community_channels ,
2020-04-20 22:05:32 +00:00
" roles " : [ named_roles [ " community " ] , named_roles [ " hacker " ] ] ,
} ,
2019-03-01 06:07:47 +00:00
}
2019-02-26 12:21:33 +00:00
# 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
2019-01-29 10:51:43 +00:00
2020-04-20 21:42:49 +00:00
# Channels that will be cleaned every minute/hour.
# This feature isn't very good rn.
# See https://github.com/reswitched/robocop-ng/issues/23
2019-01-29 10:51:43 +00:00
minutely_clean_channels = [ ]
2019-02-26 12:21:33 +00:00
hourly_clean_channels = [ ]
2019-01-29 10:51:43 +00:00
# Edited and deletes messages in these channels will be logged
spy_channels = general_channels
2019-03-01 06:07:47 +00:00
2020-04-09 18:54:27 +00:00
# All lower case, no spaces, nothing non-alphanumeric
2020-04-20 22:05:32 +00:00
suspect_words = [
2020-06-02 00:52:46 +00:00
" deepsea " , # piracy-enabling cfw
2020-04-20 22:17:20 +00:00
" sx " , # piracy-enabling cfw
" tx " , # piracy-enabling cfw
" reinx " , # piracy-enabling cfw
" gomanx " , # piracy-enabling cfw
2020-05-29 14:52:08 +00:00
" neutos " , # piracy-enabling cfw
" underpack " , # piracy-enabling cfw
" underos " , # piracy-enabling cfw
2020-04-20 22:17:20 +00:00
" tinfoil " , # title manager
" dz " , # title manager
" goldleaf " , # potential title manager
" lithium " , # title manager
2020-04-20 22:05:32 +00:00
" cracked " , # older term for pirated games
2020-04-20 22:17:20 +00:00
" xci " , # "backup" format
2020-05-29 14:52:08 +00:00
" xcz " , # "backup" format
2020-04-20 22:17:20 +00:00
" nsz " , # "backup" format
2020-05-29 14:52:08 +00:00
" hbg " , # piracy source
" jits " , # piracy source
2020-04-20 22:17:20 +00:00
]
2020-04-09 18:54:27 +00:00
2020-04-20 21:42:49 +00:00
# List of words that will be ignored if they match one of the
# suspect_words (This is used to remove false positives)
2020-04-20 22:05:32 +00:00
suspect_ignored_words = [
" excit " ,
" s/x " ,
" 3dsx " ,
" psx " ,
" txt " ,
" s(x " ,
" txd " ,
" t=x " ,
" osx " ,
2020-05-28 22:39:11 +00:00
" rtx " ,
" shift-x " ,
" users/x " ,
" tx1 " ,
" tx2 " ,
" tcptx " ,
" udptx " ,
2020-06-04 20:42:28 +00:00
" ctx " ,
2020-06-26 23:01:38 +00:00
" jit ' s " ,
2020-04-20 22:05:32 +00:00
]
2020-04-20 21:42:49 +00:00
2020-04-20 22:31:04 +00:00
# == For cogs.links ==
links_guide_text = """ **Generic starter guides:**
Nintendo Homebrew ' s Guide: <https://nh-server.github.io/switch-guide/>
* * Specific guides : * *
Manually Updating / Downgrading ( with HOS ) : < https : / / switch . homebrew . guide / usingcfw / manualupgrade >
Manually Repairing / Downgrading ( without HOS ) : < https : / / switch . homebrew . guide / usingcfw / manualchoiupgrade >
How to set up a Homebrew development environment : < https : / / devkitpro . org / wiki / Getting_Started >
Getting full RAM in homebrew without NSPs : As of Atmosphere 0.8 .6 , hold R while opening any game .
Check if a switch is vulnerable to RCM through serial : < https : / / akdm . github . io / ssnc / checker / >
"""
2020-04-20 21:56:34 +00:00
# == For cogs.verification ==
# ReSwitched verification system is rather unique.
# You might want to reimplement it.
# If you do, use a different name for easier upstream merge.
# https://docs.python.org/3.7/library/hashlib.html#shake-variable-length-digests
_welcome_blacklisted_hashes = { " shake_128 " , " shake_256 " }
# List of hashes that are to be used during verification
welcome_hashes = tuple ( hashlib . algorithms_guaranteed - _welcome_blacklisted_hashes )
# Header before rules in #newcomers - https://elixi.re/i/opviq90y.png
welcome_header = """
< : ReSwitched : 326421448543567872 > __ * * Welcome to ReSwitched ! * * __
__ * * Be sure you read the following rules and information before participating . If you came here to ask about " backups " , this is NOT the place . * * __
2021-07-15 11:38:18 +00:00
__ * * Got questions about Nintendo Switch hacking ? Before asking in the server , please see our FAQ at < https : / / reswitched . github . io / faq / > to see if your question has already been answered . * * __
2020-04-20 21:56:34 +00:00
__ * * This is a server for technical discussion and development support . If you are looking for end - user support , the Nintendo Homebrew discord server may be a better fit : < https : / / discord . gg / C29hYvh > . * * __
: bookmark_tabs : __Rules : __
"""
# Rules in #newcomers - https://elixi.re/i/dp3enq5i.png
welcome_rules = (
# 1
"""
Read all the rules before participating in chat . Not reading the rules is * not * an excuse for breaking them .
• It ' s suggested that you read channel topics and pins before asking questions as well, as some questions may have already been answered in those.
""" ,
# 2
"""
Be nice to each other . It ' s fine to disagree, it ' s not fine to insult or attack other people .
• You may disagree with anyone or anything you like , but you should try to keep it to opinions , and not people . Avoid vitriol .
• Constant antagonistic behavior is considered uncivil and appropriate action will be taken .
• The use of derogatory slurs - - sexist , racist , homophobic , transphobic , or otherwise - - is unacceptable and may be grounds for an immediate ban .
""" ,
# 3
' If you have concerns about another user, please take up your concerns with a staff member (someone with the " mod " role in the sidebar) in private. Don \' t publicly call other users out. ' ,
# 4
"""
From time to time , we may mention everyone in the server . We do this when we feel something important is going on that requires attention . Complaining about these pings may result in a ban .
• To disable notifications for these pings , suppress them in " ReSwitched → Notification Settings " .
""" ,
# 5
"""
Don ' t spam.
• For excessively long text , use a service like < https : / / 0 bin . net / > .
""" ,
# 6
" Don ' t brigade, raid, or otherwise attack other people or communities. Don ' t discuss participation in these attacks. This may warrant an immediate permanent ban. " ,
# 7
2020-04-20 22:05:32 +00:00
" Off-topic content goes to #off-topic. Keep low-quality content like memes out. " ,
2020-04-20 21:56:34 +00:00
# 8
2020-04-20 22:05:32 +00:00
" Trying to evade, look for loopholes, or stay borderline within the rules will be treated as breaking them. " ,
2020-04-20 21:56:34 +00:00
# 9
"""
Absolutely no piracy or related discussion . This includes :
• " Backups " , even if you legally own a copy of the game .
• " Installable " NSPs , XCIs , and NCAs ; this * * includes * * installable homebrew ( i . e . on the Home Menu instead of within nx - hbmenu ) .
• Signature and ES patches , also known as " sigpatches "
• Usage of piracy - focused groups ' (Team Xecuter, etc.) hardware and software, such as SX OS.
This is a zero - tolerance , non - negotiable policy that is enforced strictly and swiftly , up to and including instant bans without warning .
""" ,
# 10
2020-04-20 22:05:32 +00:00
" The first character of your server nickname should be alphanumeric if you wish to talk in chat. " ,
2020-04-20 21:56:34 +00:00
# 11
"""
Do not boost the server .
• ReSwitched neither wants nor needs your server boosts , and your money is better off elsewhere . Consider the EFF ( or a charity of your choice ) .
• Boosting the server is liable to get you kicked ( to remove the nitro boost role ) , and / or warned . Roles you possessed prior to the kick may not be restored in a timely fashion .
2020-04-20 22:05:32 +00:00
""" ,
2020-04-20 21:56:34 +00:00
)
# Footer after rules in #newcomers - https://elixi.re/i/uhfiecib.png
welcome_footer = (
"""
: hash : __Channel Breakdown : __
#news - Used exclusively for updates on ReSwitched progress and community information. Most major announcements are passed through this channel and whenever something is posted there it's usually something you'll want to look at.
#switch-hacking-meta - For "meta-discussion" related to hacking the switch. This is where we talk *about* the switch hacking that's going on, and where you can get clarification about the hacks that exist and the work that's being done.
#user-support - End-user focused support, mainly between users. Ask your questions about using switch homebrew here.
#tool-support - Developer focused support. Ask your questions about using PegaSwitch, libtransistor, Mephisto, and other tools here.
#hack-n-all - General hacking, hardware and software development channel for hacking on things *other* than the switch. This is a great place to ask about hacking other systems-- and for the community to have technical discussions.
""" ,
"""
#switch-hacking-general - Channel for everyone working on hacking the switch-- both in an exploit and a low-level hardware sense. This is where a lot of our in-the-open development goes on. Note that this isn't the place for developing homebrew-- we have #homebrew-development for that!
#homebrew-development - Discussion about the development of homebrew goes there. Feel free to show off your latest creation here.
#off-topic - Channel for discussion of anything that doesn't belong in #general. Anything goes, so long as you make sure to follow the rules and be on your best behavior.
#toolchain-development - Discussion about the development of libtransistor itself goes there.
#cfw-development - Development discussion regarding custom firmware (CFW) projects, such as Atmosphère. This channel is meant for the discussion accompanying active development.
#bot-cmds - Channel for excessive/random use of Robocop's various commands.
* * If you are still not sure how to get access to the other channels , please read the rules again . * *
* * If you have questions about the rules , feel free to ask here ! * *
* * Note : This channel is completely automated ( aside from responding to questions about the rules ) . If your message didn ' t give you access to the other channels, you failed the test. Feel free to try again.**
""" ,
)
# Line to be hidden in rules
hidden_term_line = ' • When you have finished reading all of the rules, send a message in this channel that includes the {0} hex digest of your discord " name#discriminator " , and bot will automatically grant you access to the other channels. You can find your " name#discriminator " (your username followed by a ‘ #’ and four numbers) under the discord channel list. '
2020-04-20 22:31:59 +00:00
# == Only if you want to use cogs.pin ==
# Used for the pinboard. Leave empty if you don't wish for a gist pinboard.
github_oauth_token = " "
# Channels and roles where users can pin messages
allowed_pin_channels = [ ]
allowed_pin_roles = [ ]
# Channel to upload text files while editing list items. (They are cleaned up.)
list_files_channel = 0
# == Only if you want to use cogs.lists ==
# Channels that are lists that are controlled by the lists cog.
list_channels = [ ]
2020-05-29 14:52:08 +00:00
# == Only if you want to use cogs.sar ==
self_assignable_roles = {
" streamnotifs " : 715158689060880384 ,
}
2020-09-01 07:58:35 +00:00
# == Only if you want to use cogs.mod_reswitched ==
pingmods_allow = [ named_roles [ " community " ] ] + staff_role_ids
pingmods_role = 360138431524765707
modtoggle_role = 360138431524765707
2020-10-13 14:12:32 +00:00
# == Only if you want to use cogs.yubicootp ==
2020-10-13 15:04:21 +00:00
# Optiona: Get your own from https://upgrade.yubico.com/getapikey/
2020-10-13 14:12:32 +00:00
yubico_otp_client_id = 1
2020-10-13 15:04:21 +00:00
# Note: You can keep client ID on 1, it will function.
2020-10-13 14:12:32 +00:00
yubico_otp_secret = " "
2020-10-13 15:04:21 +00:00
# Optional: If you provide a secret, requests will be signed
# and responses will be verified.