Giter Club home page Giter Club logo

you-have-been-warned's Introduction

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.

you-have-been-warned's People

Contributors

daneubi avatar liamtownsley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

xthecoolboy

you-have-been-warned's Issues

Random default reasons

It would be fun to randomly generate a default reason for a warning/revoking a warning if the user did not specify any.

This could be done by creating a new file (e.g. quotes.js) and creating two arrays of strings in it: One with reasons for warnings, and one with reasons for revoking warnings.

Once that is done all that's left is selecting one of these quotes at random at the appropriate places:

https://github.com/PatrickSachs/you-have-been-warned/blob/3ec9b7d7b7ac8218e4721f6df1712e2f1e47f058/commands/warn.js#L33-L36

https://github.com/PatrickSachs/you-have-been-warned/blob/3ec9b7d7b7ac8218e4721f6df1712e2f1e47f058/commands/unwarn.js#L33-L36

Remember warning reasons

Add a way to track the reasons for user warnings.

This allows to later see all reasons why a user has been warned before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.