Code Monkey home page Code Monkey logo

openttdiscord's Introduction

openttdiscord

Status GitHub GitHub package.json version GitHub package.json dependency version (prod)

A Discord bot for connecting OpenTTD and Discord

Table of Contents

About

This bot is currently very early, expect missing features & things to not work

This is a self hosted bot that connects a discord channel to an OpenTTD server via the Admin Port and passes chat messages between the two. It also gives status updates to the discord channel (e.g. player joins, new companies, etc.). It also allows admins some server management.

Current Status

  • Connect to Discord and OpenTTD servers and pass chat between
  • Provide basic game & server info via commands

Getting Started

Prerequisites

node.js & npm
  • Download latest version here
  • Run npm install

Set up

  • As this bot is self hosted you will need to create your own Discord App/Bot, you can follow this guide

  • Once you have your bot token, you can set up a config file. A commented example config is included in the config directory. Copy config.example.yml to config.yml and copy your bot token. You can also set another bot prefix and permission levels. If you know channel ids, you can manually add these now, alternatively you can use the bot commands to set these up, and edit them.

Inviting the bot

  • Run the bot with node index.js
  • On first run (no servers) the bot will output an invite link to the log & console. Follow this link to invite the bot to a server.

Adding servers / channels

  • Once the bot is added to your server, you can use the !newserver command to create a new OpenTTD server mapping. Optionally you can pass a name, ip and port.
  • Once you have ran this on the channels you want OpenTTD relays on, run !save to save the new config.
  • Shut down the bot, and edit the config.yml file to add the OpenTTD server's admin password.
  • Restart the bot and everything should be working.

Built Using

Authors

See also the list of contributors who participated in this project.

Acknowledgements

openttdiscord's People

Contributors

dependabot[bot] avatar kenjie20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openttdiscord's Issues

Blacklist

Add blacklists, per user/role, from discord and openttd

Discord chat doesnt showup ingame.

Hi,

Discord chat doesnt show up, it does show up that some one typed a message but the actual message is blank

image

Ingame chat does show up in discord so that works...

Command reactions

Add reactions to a users message to acknowledge that the bot has seen it

Player not being removed when desync

Players are not being cleared correctly after being disconnected

[2021-02-10 16:20:51] TRACE console;
{
    "origin": "net",
    "output": "'xxxxxx' reported an error and is closing its connection (desync error)"
}
[2021-02-10 16:20:51] TRACE console;
{
    "origin": "console",
    "output": "โ–’~@~N*** xxxxxx has left the game (desync error)"
}
[2021-02-10 16:20:51] TRACE OpenTTD client error: id; 409, error; undefined
[2021-02-10 16:20:51] TRACE OpenTTD client error: id; 409, error; undefined

Better test needs at

// Only handle clienterror when it provides an error and client was fully connected/cached, as this event fires while clients join and leave
if (client.error && this.clientInfo[client.id]) {

Getting error starting the bot

Hi i started a new server and i cant seem to get this to work.
Im new at this including github :P

See picture below
this happens when i try to start the bot via powershell command node index.js
Dont really know what to do now?

image

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.