Code Monkey home page Code Monkey logo

discordshim_rs's Introduction

discordshim_rs

Purpose

The purpose of this project is to act as a middleware between the OctoPrint-DiscordRemote plugin and discord. Originally, the plugin used discord.py, however, as discord.py advanced, it started to drop support for older python version. Separating the Discord and Octoprint parts of the plugin was the solution chosen, however, it has a few pros and cons:

Pros

  • Complete separation and decoupling of discord and plugin.
  • Simpler API, but only supports a subset of discord functionality.
  • Multi-tenant, a single DiscordShim can support multiple Octoprint plugins
  • No more requirement on creating a discord bot, new users can just use the existing bot
  • Power users can self-host DiscordShim for themselves.

Cons

  • There are privacy concerns, as the central DiscordBot sees all messages on all servers that it is added to.

Installation

Fastest way to setup the bot is to use the Docker Compose scripts.

cat <<EOT >> .env
BOT_TOKEN='$LIVE_BOT_TOKEN'
EXTERNAL_PORT=23416
EOT
docker-compose up --build -d

Development

CI

CI is hosted on a private gitlab, this is a mirror. If you wish to make a contribution, make a fork and MR as per standard github processes, and the merge will be made by the myself manually.

Testing

Rust Unit Tests

There are some rust unit tests, but no where near covered well enough.

Run with cargo test

Python System Tests

The python tests allow testing the shim end-to-end.

Run with:

# Start DiscordShim
BOT_TOKEN=$LIVE_BOT_TOKEN cargo run

# Start tests
BOT_TOKEN=$LIVE_BOT_TOKEN DISCORDSHIM_ADDR=127.0.0.1 DISCORDSHIM_PORT=53416 pytest

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.