Code Monkey home page Code Monkey logo

openttddiscord's Introduction

Openttd Discord

GitHub Test badge codecov

Provides ability to integrate Discord with your OpenTTD servers.

Documentation

Documentation link

Functionalities

  • Connects Discord channel to the Openttd Servers enabling communication between multiple servers and Discord.
    • Automatically translates ASCII emojis into Discord emojis and vice-versa.
  • Ability to execute rcon commands on server from Discord.
  • Ability to gather short reports from players about malicious behavior of other players
    • Contains information about connected clients
    • Contains last chat messages
    • Contains reason for the report
    • Some additional information
  • Creating auto-updated messages which can show status of current server.
    • It contains the same information as OpenTTD client on server browser screen.
  • Auto reply system
    • Players joining server are going to be welcomed with pre-defined message

Compilation/Installation

  • load discord bot token into environment variable ottd_discord_token

  • Use run.sh in order to run bot. (Use run.pi.sh if you are using raspberry pi.)

    • Bot automatically creates persistent SQL database on the computer where bot is being run.
  • Debugging process is the same excluding the fact that you need to launch your project instead of docker instance. It should work out of the box with environment variables set. Remember to load MySql connection string into ottd_discord_connectionstring before debugging.

    • Database creation process is described inside OpenttdDiscord.Database
    • example: Server=1.2.3.256;User ID=openttd;Password=yoursupersecretpassword;Database=openttd

Bots required permissions

  • View channels
  • Send Messages
  • Embed files

Read more about permissions in official Discord documentation

Development

Conventional commits

This repository uses Conventional commits to specify type of commits commited to the repository.

Used types:

  • feat - feature
  • fix
  • ref - refactor
  • docs - documentation
  • nuget - commits connected with nuget upgrade/downgrade
  • chore

Architecture

Actors hierarchy

Actors hierarchy

Database diagram

Database diagram

Test coverage

Test coverage graph

openttddiscord's People

Contributors

dependabot[bot] avatar seler09 avatar shoter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openttddiscord's Issues

Attach codecov tool and create github action for it

Github action should do following:

  • Build a project.
  • Run all tests (including docker tests). It might require some changes to run docker tests on github actions.
  • Publish test results to codecov.

Triggers on PullRequest and on master branch.

It is already implemented in OpenTTDAdminPort: https://github.com/shoter/OpenTTDAdminPort/blob/master/.github/workflows/ci.yml

Docker tests are also implemented in OpenTTDAdminPort: https://github.com/shoter/OpenTTDAdminPort/blob/master/OpenTTDAdminPort.Tests/Dockerized/DockerizedTest.cs

where is run.sh or how do you build this?

The readme.md states "run build.sh to build docker image" but there is no build.sh at least for the bot / docker image.

I tried docker-compose and it outputs this:

=> CANCELED [openttddiscord_bot internal] load metadata for mcr.microsoft.com/dotnet/core/runtime:3.1 0.0s
=> CANCELED [openttddiscord_bot internal] load metadata for mcr.microsoft.com/dotnet/core/sdk:3.1 0.0s
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name ":latest": invalid reference format

Health Check

Add health check ability to the bot:

  • Check simple response time without any contact with ottd
  • Simple ping to ottd server

Change all commands to commands with auto suggestions starting with slash `/`

Discord introduced auto suggesting commands that are starting with slash / (It would be nice also to check whether we can use other symbols rather than / and check if user can configure that).

Rcon channel should be left with the same logic. It does not need auto suggestions. It should accept commands as it is.

image

Discord bot permissions

What permissions does the bot need? Eveything seemed to work up until I tried to use change_password. DM never came through.

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.