Skip to content

SachsKaylee/you-have-been-warned

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

you-have-been-warned ๐Ÿ‘Ž

!! NEW: Try out the Sahnee Bot, it has the same features & more, but is actively maintained: https://github.com/Sahnee-DE/sahnee-bot !!

A bot that manages user warnings. Use it to enforce roles on your channel or to annoy your friends other serious stuff.

Why?

This project was born out of a joke among friends for giving each other warnings on Discord for the most ridiculous of things.

At some point manually remember each warning and managing it in Discord became way too cumbersome and we decided to automate this process.

Even though born out of a joke, this bot is also suited for practical use.

Commands

  • /warn @Who Your reason here! - Issues a warning to the given user. The reason is optional. The user will also be notificed personally about their most evil transgression.
  • /unwarn @Who Your reason here! - Revokes a warning from the given user. If you are feeling generous you can also inform the user why a warning was revoked. The user will also be notified personally.
  • /warnall Your reason here! - Issues a warning to EVERYONE on your discord server. Yes, everyone includes yourself and this bot.

Get the bot on your server

Click, click, done - Bot hosting provided by sahnee.de

You're done, enjoy! (Keep in mind that when using the public bot only admins & users that can kick/ban/manage roles can issue warnings)

Want to host the bot on your own server or join in on developing? Then keep reading!

How to install on your own hardware

Open a Terminal and enter git clone https://github.com/PatrickSachs/you-have-been-warned (git required). Then open the folder.

Copy config.json.tpl to config.json. Let's go through the settings.

Setting Description
id The client ID of the bot. The client I am hosting publically is "579045890346713108", if you want to run your own insert your ID here.
permissions The permissions of this bot. By default the bot has permission 8 which makes it an administrator. (This is subject to change in a later version)
token Your super secret bot token. See below on how to generate one.
openBrowser If you are running on a GUI based OS(how fancy!) and this setting is true a browser window with further instructions will open upon starting the bot. Set to false to disable.
command_prefix Defines the prefix for using the pornimage command. Can be any single character. By dfault this is set to /.
warningPrefix Users will be given a role based on their warning count. If this value is e.g. set to "warnings: " the role of 4 warnings will be named "warnings: 4".
warningRadix Only change this if you want your bot to be super nerdy. E.g. setting this to 16 will make your warning count be displayed in hexadecimal, or 2 for binary. 10 is the sane setting.
admin In order to issue warnings a user must have at least one of these permissions.

How to get a token & client ID? https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token

If case you get lost, this is the default config:

{
  "id": "579045890346713108",
  "permissions": 8,
  "token": "- YOUR TOKEN HERE -",
  "openBrowser": true,
  "command_prefix": "/",
  "warningPrefix": "warnings: ",
  "warningRadix": 10,
  "admins": [
    "ADMINISTRATOR",
    "KICK_MEMBERS",
    "BAN_MEMBERS",
    "MANAGE_ROLES",
    "MANAGE_ROLES_OR_PERMISSIONS"
  ]
}

Time to spin it up! Open a terminal in the and enter npm i followed by npm run start(NodeJS required). A browser window will now open that allows you to add the bot to your server.

If no browser window opened go to https://discordapp.com/oauth2/authorize?&client_id=<CLIENTIDHERE>&scope=bot&permissions=8 (Replace <CLIENTIDHERE> with your client ID).

Keep in mind that once you close the Terminal the bot will no longer respond to commands.