Giter VIP home page Giter VIP logo

twisted-discord-interactions's Introduction

twisted-discord-interactions

WARNING Still a major work in progress! Not fully functional

A Twisted-based Python discord interactions web server implementation

Heavily inspired by the existing discord-interactions.py project

Installation

WIP

Example Usage

from twisted_discord_interactions import RequestData, InteractionClient, InteractionCommand, CommandOption, CommandOptionType

def my_command_callback(request_data: RequestData):
    do_something = True
    return b"Text response to interaction"


if __name__ == "__main__":
    pub_key = open("key.txt", "r").read().strip("\n")
    client = InteractionClient(pub_key)
    test_command = InteractionCommand(
        name="test", 
        description="test command",
        id=0,
        application_id=0,
        options=[
            CommandOption(
                type=CommandOptionType.STRING, 
                name="test_val", 
                description="Testing Value",
                required=False
            )
        ]
    )
    client.register_command(test_command, my_command_callback)
    client.start_site()

twisted-discord-interactions's People

Contributors

column01 avatar

Watchers

 avatar  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.