Skip to content

Releases: breqdev/flask-discord-interactions

Fix issue with PyPI build

16 Oct 02:24
Compare
Choose a tag to compare

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

10 Sep 21:31
dd55be5
Compare
Choose a tag to compare

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

24 Aug 01:48
8cd795d
Compare
Choose a tag to compare

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

24 Aug 00:39
c8cc0f8
Compare
Choose a tag to compare

This release fixes how the Member object parses avatar URLs. Thank you to @TheJaffaMeme for reporting this issue! (Issue #47, PR #48)

Update for Discord API change

16 Aug 20:25
f689c3a
Compare
Choose a tag to compare

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

15 Aug 19:14
625ee52
Compare
Choose a tag to compare

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

15 Aug 17:32
8322351
Compare
Choose a tag to compare

v1.0.0 -- Permissions, SelectMenus, New Option Types

11 Aug 02:09
84e45b5
Compare
Choose a tag to compare

This PR adds several new features:

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

Fix bugs with subcommands, Context objects, and return value handling

05 Jul 00:52
074d5f8
Compare
Choose a tag to compare

This release fixes an issue with the construction of Context objects (#29, #30). Thank you to @jethrob for reporting this issue!

Other changes:

  • Fixed issue with subcommand return value handling (1869ceb)
  • Decreased minimum Python version to 3.7, we were already running unit tests targeting it (219efd7)

Message Components and custom handlers!

08 Jun 21:19
ae80f2e
Compare
Choose a tag to compare

This PR adds support for:

  • Message Components (#25)
  • Storing state in custom IDs (#27)

It also fixes some permissions-related bugs (acbe032) and uses the new API endpoint for updating commands (#24).