Skip to content

Commit

Permalink
update 1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
3ddelano committed Oct 4, 2021
1 parent 7117117 commit 7d594ad
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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.1.5
------
- Added `DiscordBot.create_dm_channel()`
- Added `DiscordBot.get_guild_emojis()`
- Added emoji support for `MessageButton`

1.1.4
------
- Added `DiscordBot.get_guild_member()`
Expand Down
13 changes: 11 additions & 2 deletions addons/discord_gd/classes/message_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var label: String setget set_label, get_label
var custom_id: String setget set_custom_id, get_custom_id
var url: String setget set_url, get_url
var disabled: bool = false setget set_disabled, get_disabled
#var emoji: String
var emoji: Dictionary

var _style setget set_style, get_style
var type: int = 2
Expand Down Expand Up @@ -61,6 +61,14 @@ func get_disabled() -> bool:
return disabled


func set_emoji(new_emoji: Dictionary):
emoji = new_emoji
return self

func get_emoji() -> Dictionary:
return emoji


func _init():
return self

Expand Down Expand Up @@ -89,5 +97,6 @@ func _to_dict() -> Dictionary:
'style': _style,
'label': label,
'custom_id': custom_id,
'disabled': disabled
'disabled': disabled,
'emoji': emoji
}
9 changes: 9 additions & 0 deletions addons/discord_gd/discord.gd
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,20 @@ func get_guild_icon(guild_id: String, size: int = 256) -> PoolByteArray:
return png_bytes


func get_guild_emojis(guild_id: String) -> Array:
var res = yield(_send_get('/guilds/%s/emojis' % guild_id), 'completed')
return res

func get_guild_member(guild_id: String, member_id: String) -> Dictionary:
var member = yield(_send_get('/guilds/%s/members/%s' % [guild_id, member_id]), 'completed')
return member


func create_dm_channel(user_id: String) -> Dictionary:
var res = yield(_send_request('/users/@me/channels', {"recipient_id": user_id}), 'completed')
return res


func remove_member_role(guild_id: String, member_id: String, role_id: String):
var res = yield(_send_get('/guilds/%s/members/%s/roles/%s' % [guild_id, member_id, role_id], HTTPClient.METHOD_DELETE), 'completed')
return res
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.4"
version="1.1.5"
script="plugin.gd"

0 comments on commit 7d594ad

Please sign in to comment.