Coder Social home page Coder Social logo

melijn / melijn-bot Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 10.0 17.21 MB

A multipurpose discord bot written in kotlin, using jda

Home Page: https://melijn.com

License: GNU Affero General Public License v3.0

Kotlin 99.79% JavaScript 0.10% Dockerfile 0.11%
discord discord-bot hacktoberfest jda jda-ktx kotlin

melijn-bot's Introduction

melijn-bot

A multipurpose discord bot written in kotlin Some libraries we use:

  • jda - java discord api
  • kord-extensions - kord command framework and utils
  • kord-kommons - kord discord bot utilities and exposed SQL code generation utils
  • ktor - kotlin http client/server
  • exposed - kotlin SQL framework from jetbrains (we don't use the DAO's)

general information

This is the third rewrite of Melijn (links to previous and first repositories). These projects serve as a fun hobby project and learning place for me. Over the years we have grown a lot in size (amount of users) and our current codebase was messy and kinda unmaintainable (over 260 top level commands and about 80 database tables). This rewrite will keep scalability and maintainability in mind. Our website will also reside in this repository and use ktor. NO MORE JS FRAMEWORK WOOHOO.

Contributions

Contributions are welcome <3
Please follow the following guidelines to make it a nice experience for everyone.

  1. Check if there is an issue for what you want to add (if not create one)
  2. If there is an issue, check that there is no one working on it already (open draft PRS or replies indicating that someone is working on it).
  3. Don't solve multiple github issues in one PR (bug fixes or typos are acceptable)
  4. Follow our coding style and naming conventions.

Development environment

You will need:

  • a Postgresql server
  • a Redis server
  • a discord user account, bot user and server

If you want to use docker for your dev environment: example-docker-compose.yml

Optional (related features won't work unless supplied ofcourse):

  • Lavalink server (for music)
  • Spotify developer application tokens
  • Other API keys

Make sure intellij is using UTF-8 for property files, otherwise unicode might replaced with ? in messages. KSP code generation may sometimes print random errors (e.g. -1), just recompile will fix them normally :/

Starting the bot is done using the main function in Melijn.kt at the bottom.

An example configuration can be found here: ./example.env
Copy it to .env and place it in the root (same level as example.env)

Selfhosting

You will need:

  • a Postgresql server
  • a Redis server
  • a discord user account, bot user and server

and optionally: - [Lavalink](https://github.com/freyacodes/Lavalink) server (for music) - Spotify developer application tokens - Other API keys

It is recommended to run the bot inside docker using the example-docker-compose.yml.
To update the version you can use the :latest version tag OR you can manually update the version hash (you can find the latest version hashes here).

docker compose pull; docker compose down; docker compose up -d pulls the latest version if using :latest and restarts the containers.

For installing docker and docker-compose follow these instructions:

Inside the .env file you can point to the service name of the other containers inside this file as host (e.g. DB_HOST=melijn-postgres), docker will route it to the correct container

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.