Git Product home page Git Product logo

discord-rs's Introduction

discord-rs

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)

discord-rs's People

Contributors

artemgr avatar arzte avatar belst avatar bocom avatar dancojocaru2000 avatar fizyk20 avatar fomoshlomo avatar iddm avatar io12 avatar mammothbane avatar mmirate avatar mraof avatar spacemaniac avatar tinaun avatar tormyst avatar valleyflowerbear avatar xaeroxe avatar

Stargazers

 avatar

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.