Git Product home page Git Product logo

flobot's Introduction

Moderation Bot in TypeScript using discordjs v14

This project was programmed by some members of Florian Dalwigk's community discord which unfortunately doesn't exist anymore. You can find the new Discord Server here. The bot uses discordjs v14 and is written entirely in TypeScript. We also use a github workflow to automatically deploy the bot on our own server.

Function overview

Command Function
/kick Kicks a user
/ban Bans a user
/timeout timeout a user
/warn warns a user
/strike strikes a user
/about about me
/help shows a multi page information widget
/bj help shows the help information for the BlackJack sub commands

Development

To setup your bot, you have to copy the env.example to .env and set your TOKENs and IDs:

BOT_TOKEN=YOURTOKEN
APPLICATION_ID=YOUR_APPLICATION_ID
TOGGLE_ROLES= <IDs von rollen, die sich Nutzer selbst geben können. Mit, getrennt. Maximal 5 (weil man nicht mehr buttons in eine Nachricht machen kann)>
DB_PATH=<path to sqlite3 db>
REPORT_CHANNEL_ID= <channel, in den Reports geschickt werden sollen>
TICKET_SUPPORTER= <ID der Rolle, die jedem Ticket hinzugefügt wird>
MESSAGE_LOGS= <ID des Channels, in dem gelöschte & bearbeitete Nachrichten protokolliert werden sollen>
JOIN_LOGS= <ID des Channels, in dem protokolliert wird wenn ein Nutzer den Discord betritt/verlässt>

You can also configure the logging behavior in logging.json.

npm commands

The bot is tested with Node Version 18.x

npm ci # to install dependencies
npm run lint # this runs the code linter
npm test # this executes the jest unit tests
npm run dev # this starts the bot with nodemon
npm run start # this starts the bot as in production

flobot's People

Contributors

chfuchte avatar dependabot[bot] avatar einskatze avatar filip326 avatar mickhat avatar oglimmer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

einskatze

flobot's Issues

Check if giveaway is due in sqlite, not ts

const giveawayArr = await db.allAsync(`SELECT message_id, prize, timestamp, status, organizer_id, channel_id FROM giveaways WHERE status = 0 and channel_id is not null`, [])

Here all open giveaways are fetched from the sqlite db and checked if due afterwards. It should be possible to fetch only the due giveaways.

SlashCommand: ban

Bei ban ist der user fuer xx monate/wochen weg.

z.b

/ban <user> 3d reason: regelmissbrauch
  • Rechte Maustaste -> App ist nicht erwünscht
  • logging der aktion über logger.log() (kein Eintrag in sqlite)

Waving when greeting

Perhaps add a reaction like waving when greeting someone. A greeting could be "moin", "servus" or "hallo".

Rewrite texts

Rewrite some texts of the Bot since the original dc is down.

SQLite tests fails

The tests in SQLite fail in the Container. It works fine on Windows locally.

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.