Releases: breqdev/flask-discord-interactions
Fix issue with PyPI build
The reorganization in v1.1.0 added additional packages to the project which were not properly listed in setup.py
. This release changes the project configuration to include all applicable packages.
(Edit: release is "unverified" because commits were made using github.dev
).
Add support for User and Message commands
This release adds the following:
The new ApplicationCommandType enum
This lets you declare a User or a Message command. For more information about these new types of commands, see the Discord docs.
The syntax is as follows:
@discord.command(name="High Five", type=ApplicationCommandType.USER)
def highFive(ctx, target):
return f"{ctx.author.display_name} wants to say hello to {target.display_name}"
Thank you @fmdaboville for this contribution! (Issue #50, PR #51)
Response
is now Message
To support Message commands, the Response
class is now the Message
class. It is now used to represent incoming messages (from message commands) in addition to outgoing messages (i.e., sent by the bot). It gains some new fields, notably id
, channel_id
, timestamp
, and author
, which are only set for these incoming messages. (PR #52)
The old name (Response
) will still work, but it is officially deprecated and will raise a warning.
Other renaming
In addition, SlashCommand
has become Command
, DiscordInteractions.update_slash_commands
has become update_commands
, etc. Again, the old names still work, but they are deprecated. (PR #52)
Internal reorganization
Internally, models such as the Message, User, Member, and Command classes were reorganized. This shouldn't cause any changes from the user perspective, but it's something to note! (PR #52)
Support and document use of RQ for background tasks
This change adds the following features (#49):
Context.freeze
method to produce a pickleable Context that can be passed to RQ.- Examples and documentation for writing an app using Flask-Discord-Interactions with RQ.
Fix bug with Avatar URL
Update for Discord API change
Discord, as of now, has moved the resolved
field out of the base interaction
object and into the interaction.data
object. This release accommodates this change. Thank you to @TheDevFreak for reporting this issue.
Please upgrade to this release if you are experiencing issues with using the Member, Role, etc. types.
Quart: Keep a single ClientSession
Previously, each instance of AsyncContext created its own aiohttp ClientSession to send requests to Discord. However, it was unclear when to close this session, as background tasks could continue to make use of it after the initial response had been sent.
This release uses a ClientSession stored at the application level instead. This session is created using @app.before_serving
and closed using @app.after_serving
automatically for Quart apps. This is handled within app.set_route_async
.
This release deprecates AsyncContext.close()
.
Fix permissions bug preventing slash command groups from being registered
Hotfix for issue #43.
v1.0.0 -- Permissions, SelectMenus, New Option Types
This PR adds several new features:
- Additional option types
NUMBER
andMENTIONABLE
(#38, thank you @williamhatcher!) - Command permissions (#21, #40)
- The SelectMenu component (#37, #39)
This is version 1.0.0. This means that this library is committing to maintaining a stable API going forward, in order to support the numerous projects that have begun using it.
How do I know when to release 1.0.0?
If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.
- SemVer FAQ