Git Product home page Git Product logo

bonusbot's Introduction

BonusBot

Discord bot written in C# using the framework Discord.Net.

What exactly is BonusBot?

BonusBot has been written to do some stuff in Discord like for example:

  • Play music from YouTube
  • Delete multiple messages at once
  • Ban people for a specific time and inform them
  • Announce game planings for one of our Discord servers
  • Output when someone leaves the server
  • ... and much more

My previous repository could do all of them and maybe more (depends on at which date you are reading this).
But the code was terrible so I decided to rewrite the whole code.
Well, atleast it was much better than my first BonusBot :)

How can I get the bot?

You can't invite the bot I'm already running for my private servers.
I honestly don't have a server with enough resources to be able to handle many guilds.

But you can:
Clone this repository
or
Use my Docker image directly.

Environment variables:

  1. BONUSBOT_TOKEN
    The token of the bot.
  2. BONUSBOT_CLIENT_ID
    The "CLIENT ID" of the bot (needed for WebDashboard.
  3. BONUSBOT_CLIENT_SECRET
    The "CLIENT SECRET" of the bot.
  4. BONUSBOT_WEB_BASE_URL
    The base url where the ASP.NET Core server is running.
    E.g. my base url is "http://bonusbot.net".
  5. BONUSBOT_ACTIVITY
    Activity of the bot when started.
  6. BONUSBOT_CONNECTION_STRING
    Connection string for PostgreSQL.

How is the code structured?

There are the main, systems and module projects.

The main projects contain the logic to make BonusBot function for any functionality:

  • Core:
    Startup, Initialization, Dependency Injection, module references
  • Common:
    Common logic for everything.
  • Database:
    Entity Framework Core using PostgreSQL.
  • Services:
    Services needed for BonusBot to work.

System projects are wrapper for Discord classes to mostly improve speed of the bot with caching and make the code better.

Modules contain all the functionalities and commands.
They can be added and removed easily, need to be referenced from Core and need to end with 'Module'.
The module 'ModulesControllingModule' allows the guild administrators to enable and disable the modules for their guild.

Other used dependencies:

  • Lavalink:
    Used in AudioModule for sending audio from e.g. YouTube or Soundcloud
  • gRPC with Google.Protobuf:
    For my private modules to allow sending to and receiving from my other project.
  • Npgsql Entity Framework Core Provider
    Provider for EF Core and PostgreSQL.
  • Macross.Json.Extensions:
    To be able to convert string to enum or vice versa with custom names in System.Text.Json.
  • Colorful.Console:
    Enhanced styling functionality for the console.
  • MoreLINQ:
    More functionalities for LINQ.
  • Docker:
    This code is written to work in a Docker container. If you don't want to use it, you can modify the code - it should be pretty easy.
    E.g. the ConnectionString in BonusDbContextFactory.cs uses an absolute path for a Docker volume, modify it.
  • ... and more from .NET Team

bonusbot's People

Contributors

emre1702 avatar jeremyespresso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.