• Stars
    star
    387
  • Rank 110,971 (Top 3 %)
  • Language
    Rust
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust library for the Discord chat client API

discord-rs

This project is only maintained occasionally. If you're having problems, open a pull request or check the network graph for up-to-date forks.

discord-rs is a Rust client library for the Discord chat client's API.

The Discord API can be divided into three main components: the RESTful API to which calls can be made to take actions, a websocket-based permanent connection over which state updates are received, and the voice calling system.

Log in to Discord with Discord::new, new_cache, or from_bot_token as appropriate. The resulting value can be used to make REST API calls to post messages and manipulate Discord state. Calling connect() will open a websocket connection, through which events can be received. These two channels are enough to write a simple chatbot which can read and respond to messages.

For more in-depth tracking of Discord state, a State can be seeded with the ReadyEvent obtained when opening a Connection and kept updated with the events received over it.

To join voice servers, call Connection::voice to get a VoiceConnection and use connect to join a channel, then play and stop to control playback. Manipulating deaf/mute state and receiving audio are also possible.

For further details, browse the source or read the documentation. For examples, browse the examples directory.

Installation

On Windows, discord-rs currently requires a GNU-like environment. For details, read the installation guide.

On all platforms, discord-rs has several system dependencies, which should be installed as appropriate:

  • pkg-config
  • openssl
  • libsodium (if using voice)
  • opus (if using voice)
  • ffmpeg (if using ffmpeg features)
  • youtube-dl (if using youtube-dl features)

More Repositories

1

SpacemanDMM

A BYOND language smartness provider, map renderer, and more.
Rust
83
star
2

opus-rs

Safe Rust bindings for libopus
Rust
68
star
3

PermissionsBukkit

A simple permissions and groups plugin for Bukkit's permissions system.
Java
64
star
4

runtime-fmt

Runtime string formatting for Rust
Rust
62
star
5

HamSandwich

Source code and modding kit for Hamumu's Dr. Lunatic series.
C++
38
star
6

hullrot

A minimalist Mumble server with immersive Space Station 13 integration.
Rust
19
star
7

vscode-dm-langclient

VS Code extension for SpacemanDMM's dm-langserver. Report issues on SpacemanDMM.
TypeScript
9
star
8

McURL2

McURL is a unique tool that allows you to jump onto Minecraft SMP servers straight from your favorite browser.
Java
8
star
9

McURL

Old version of McURL, a tool for connecting to Minecraft servers through links in a browser.
Java
8
star
10

Spacecraft-GT

Spacecraft GT is a new, Survival Multiplayer rendition of Spacecraft, the SpaceManiac Minecraft Server.
C#
7
star
11

Nether

A Minecraft Bukkit plugin that adds super-simple single-player-like Nether portals.
Java
7
star
12

mumble-link-rs

A Rust library for using Mumble's Link plugin for positional audio.
Rust
6
star
13

MiniPython

From-scratch replacement for now-defunt PythonPluginLoader. Still needs some work.
Java
5
star
14

RobotWantsAdventure

Robot Wants Kitty: Adventure Edition is an expansion on the original Robot Wants Kitty competition code, and adds many features such as custom levels and configurable settings
ActionScript
5
star
15

vscode-opendream

TypeScript
4
star
16

Spacecraft

Spacecraft is the SpaceManiac Minecraft Server, a C# server for Minecraft (http://minecraft.net) licensed under CC-BY-SA
C#
3
star
17

Lunatic

Old SPISPOPD II: Dr. Lunatic repository - now part of HamSandwich
C++
3
star
18

lua-kit

Rust toolkit for working with Lua bytecode
Rust
3
star
19

GGJ

"What To Do in a Desert" - Desert escape game for GGJ 2015
Java
1
star
20

EggTimer

A Minecraft Bukkit plugin that adds timed item dropoffs using chests.
Java
1
star