GithubHelp home page GithubHelp logo

jaarke / discord-lambda-py Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 57 KB

An ongoing project dedicated to adapting the discord.py library for use in a serverless environment.

Python 100.00%
aws-apigateway aws-lambda discord-bot discord-py template

discord-lambda-py's People

Contributors

jaarke avatar

Stargazers

 avatar

Watchers

 avatar

discord-lambda-py's Issues

Add edit_response and edit_followup to Interaction class

These functions are self explanatory. They would allow a user to edit response and followup messages after they have been sent with send_response or send_followup.

edit_response will be straightforward. The API for editing a response only depends upon the Interaction token, which is readily available in our Interaction object.

edit_followup will be more intensive. We will need to develop a way of receiving message data back from the Discord API after sending each followup. send_followup will then need to store and return this message data so that the user can eventually edit the message using the returned object. See this page for relevant documentation.

Create a Command class

Using a class to define commands, rather than functions, will likely make it easier for users to define their own commands. Custom commands could extend this class or use decorators to invoke a higher-tier function responsible for adding each command to the CommandRegistry. Further, this organization would more closely resemble that of the slash-create library.

Command objects should hold information including:

  • Command name
  • Command description
  • Command inputs
  • Subcommand membership
  • Function to be run when the command is invoked (run() or something similar)

Develop instructions for reducing cold start performance limitations

The AWS setup currently sanctioned by the README is susceptible delays when the Lambda undergoes a cold start. Often, the bot appears unavailable on the user's first request because the Lambda takes too long to initialize.

There are various ways of circumventing the cold start delay, but one of the most popular seems to be having two separate Lambda functions: one for the initial "I hear you" response, and another to perform and respond to the request. This approach is explained in detail in this tutorial.

Adding this functionality would ensure users could develop responsive applications with this template.

Record setup tutorial video

For a template repository, it is of the utmost importance to make it easy for prospective developers to get a project setup. As such, it would be wise to include a tutorial video as part of our README walking through the Discord, AWS, and GitHub setup processes.

Implement from_dict in Embedding class

The Embedding class currently provides a to_dict function for converting class data into a dictionary. It would be easy enough to add a function for the opposite conversion, and such a function might make it easier for users to create custom Embeddings, so long as they were made aware of the supported dictionary structure.

The from_dict function would be a static function that initializes an Embedding object from a dictionary parameter. This would require mapping dictionary fields to class attributes in the same way they are mapped in the to_dict function.

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.