Coder Social home page Coder Social logo

rusty-interaction's Introduction

ci-img cio-img lic-img doc-img

Rusty Interaction

This library provides types and helper functions for handling Discord's Interactions. It also provides an actix-web backend handler system to handle Interactions through your own API (instead of using the gateway).

Getting started

To install this library, add this dependency entry to your Cargo.toml file:

rusty_interaction = "0"

By default, this only exposes the types and security check function. If you want to use the handler, add the following to your Cargo.toml:

[dependencies.rusty_interaction]
version = "0"
features = ["handler"]

Take a look at the documentation and the examples to get yourself familiar with using the library.

Basic bot/handler

Please take a look at the following examples:

Contributing

More than welcome! :D

What it has right now

  • - Data models exposure
  • - Interaction validation (crate::security::verify_discord_message())
  • - Receive Interactions from Discord
  • - Bind interactions to a function (with the help of a macro)
  • - Properly respond to interactions from Discord
  • - Nice system to make follow-up messages.
  • - Nice system to manage guild-specific commands.
  • - Support for components (buttons, dropdowns, etc)
  • - Not a pile of spaghetti code that just works (oops...๐Ÿ‘€)

Difference between receiving interactions through the gateway and your own endpoint

The gateway requires you to have a discord client where you receive interactions. Setting up your own endpoint makes Discord send the interactions to your own API endpoint (ex. https://example.com/api/discord/interactions).

If you already have an API that runs your service and you're looking to integrate with Discord, this way of receiving interactions can be really interesting.

One distinct difference is that you do not need a bot or oauth token for most features. Some features (like command management) do require a bot token.

Ok, I want to receive interactions through the gateway. Does your library support that?

No. If you want to receive interactions through the gateway, you want to take a look at Serenity or one of the other libraries.

rusty-interaction's People

Contributors

showengineer avatar denbeigh2000 avatar d1str4ct avatar soruh avatar

Watchers

James Cloos 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.