Skip to content

Commit

Permalink
update 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
3ddelano committed Dec 24, 2021
1 parent 182fba6 commit 0aa0d77
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog
This is a high-level changelog for each released versions of the plugin.
For a more detailed list of past and incoming changes, see the commit history.

1.2.0
------
- Fixed some bugs in `DiscordInteraction` regarding updating the message of interaction.
- Fixed typo in SelectMenu

1.1.9
------
### Implemented application commands (CHAT_INPUT / USER / MESSAGE commands) and also autocomplete response for application commands
Expand Down
14 changes: 10 additions & 4 deletions addons/discord_gd/classes/discord_interaction.gd
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,17 @@ func _send_request(
'components': _components
}
}
if message != null:

if _type == RESPONSE_TYPES['UPDATE_MESSAGE']:
# Append the message parts from the original message if the options doesnt contain that part
if not options.has('tts'):
payload.tts = message.tts
payload.data.tts = message.tts
if not options.has('content'):
payload.content = message.content
payload.data.content = message.content
if not options.has('embeds'):
payload.data.embeds = message.embeds
if not options.has('components'):
payload.data.components = message.components

if method == HTTPClient.METHOD_PATCH or is_follow_up:
payload = payload.data
Expand Down Expand Up @@ -363,7 +369,7 @@ func _to_dict() -> Dictionary:
'version': 1,
'type': type,
'token': token,
'message': message or {},
'message': message._to_string() if message is Message else {},
'member': member,
'id': id,
'guild_id': guild_id,
Expand Down
2 changes: 1 addition & 1 deletion addons/discord_gd/classes/select_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func add_option(value: String, label: String, data: Dictionary = {}):
_data['description'] = data.description

if data.has('emoji'):
assert(typeof(data.emoji) == TYPE_DICTIONARY, 'emoji of SelecMenu option must be a Dictionary')
assert(typeof(data.emoji) == TYPE_DICTIONARY, 'emoji of SelectMenu option must be a Dictionary')
_data['emoji'] = data.emoji

if data.has('default'):
Expand Down
2 changes: 1 addition & 1 deletion addons/discord_gd/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="discord.gd"
description="A Discord bot API wrapper for Godot."
author="Delano Lourenco"
version="1.1.9"
version="1.2.0"
script="plugin.gd"

0 comments on commit 0aa0d77

Please sign in to comment.