Discord reaction role bot implementation in Rust

Built with Rust is installed

reaction-roles

Overview

.
Built with serenity.

- This is my first time using Rust, so this code likely won't have the best practices in it.
- If you found reaction-roles helpful or neat please consider leaving a star ⭐

Usage

- Assuming Rust is installed.

  • Clone the repository (git clone https://github.com/Metacinnabar/reaction-roles.git && cd reaction-roles)
  • Rename example.env to .env (mv example.env .env)
  • Edit .env following dotenv (nano .env)
  • Edit config.json following configuration (nano config.json)
  • Run the bot with cargo (cargo run)

Dotenv

Example .env file:

DISCORD_TOKEN=TOKEN
RUST_LOG=INFO

DISCORD_TOKEN - Discord bot token for your bot

  • How do I get a Discord bot token?

RUST_LOG - Console logging level (ERROR, INFO, DEBUG)

Configuration

Example config.json file:

{
  "message_id": 884599663049313832,
  "emotes": [
    "<:emotename:884597154617730385>",
    "<:emotename2:884598528095427644>"
  ],
  "role_ids": [
    884597587997503708,
    884597734784564692
  ]
}

The first entry in emotes matches the first entry in role_ids.

key desc value example
message_id message id for reaction roles 884599663049313832
emotes array of emote ids (fetched with /:customemote:) [ "<:emotename:884597154617730385>", "<:emotename2:884598528095427644>" ]
role_ids array of role ids [ 884597587997503708, 884597734784564692 ]

Todo

  • Json config for message id, emotes, and roles
  • Generalize & modularize code
  • Properly log events to console
  • (Optional config) Log reactions to a channel
  • (Optional config) DM the user who reacted

Support

For any bug reports, questions, or requests please create an issue via the issue tracker.

License

reaction-roles is licensed under the MIT License.

Issues

Collection of the latest Issues

Information - Updated Apr 01, 2022

Stars: 1
Forks: 0
Issues: 1

Serde is a framework for serializing and deserializing Rust data structures efficiently and generically

Rust Greatest JSON weapon is Serde with over 4.4K stars on github and a massive developer community. This is considered a core Rust library for every developer to learn in BRC's opinion

Serde is a framework for serializing and deserializing Rust data structures efficiently and generically

Rust 버전 JsonPath 구현으로 Webassembly와 Javascript에서도 유사한 API 인터페이스를 제공 한다

JsonPath 구현으로 Webassembly와 Javascript에서도 유사한 API 인터페이스를 제공 한다

Rust 버전 JsonPath 구현으로 Webassembly와 Javascript에서도 유사한 API 인터페이스를 제공 한다

SIMD JSON for Rust  

Rust port of extremely fast serde compatibility

SIMD JSON for Rust  

JSON-E Rust data-struct paramter crate for lightweight embedded content with objects and much more

What makes JSON-e unique is that it extensive documentation and ease of use

JSON-E Rust data-struct paramter crate for lightweight embedded content with objects and much more
JSON

111

A Rust JSON5 serializer and deserializer which speaks Serde

Deserialize a JSON5 string with from_str

A Rust JSON5 serializer and deserializer which speaks Serde

Rust JSON Parser Benchmark

Download and Generate JSON Data

Rust JSON Parser Benchmark

Read JSON values quickly - Rust JSON Parser

AJSON get json value with specified path, such as project

Read JSON values quickly - Rust JSON Parser

Command line json text parsing and processing utility

parsing json compliant with rust and cargo

Command line json text parsing and processing utility

Rust actix json request example

Send a json request to actix, and parse it

Rust actix json request example

Why yet another JSON package in Rust ?

======================================

Why yet another JSON package in Rust ?
JSON

140

json_typegen - Rust types from JSON samples

json_typegen is a collection of tools for generating types from

json_typegen - Rust types from JSON samples

Rust JSON parsing benchmarks

This project aims to provide benchmarks to show how various JSON-parsing libraries in the Rust programming language perform at various JSON-parsing tasks

Rust JSON parsing benchmarks
Facebook Instagram Twitter GitHub Dribbble
Privacy