jaarke / discord-lambda-py Goto Github PK
View Code? Open in Web Editor NEWAn ongoing project dedicated to adapting the discord.py library for use in a serverless environment.
An ongoing project dedicated to adapting the discord.py library for use in a serverless environment.
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.
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:
run()
or something similar)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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.