lib_discord 0.1.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +88 -0
- data/README.md +39 -65
- data/lib/lib_discord/client.rb +2665 -138
- data/lib/lib_discord/formatter.rb +108 -0
- data/lib/lib_discord/maps.rb +731 -0
- data/lib/lib_discord/permissions.rb +85 -0
- data/lib/lib_discord/urls.rb +3 -12
- data/lib/lib_discord/version.rb +1 -4
- data/lib/lib_discord.rb +3 -5
- metadata +10 -119
- data/CHANGELOG.md +0 -142
- data/lib/lib_discord/application.rb +0 -43
- data/lib/lib_discord/application_command.rb +0 -341
- data/lib/lib_discord/application_role_connection_metadata.rb +0 -52
- data/lib/lib_discord/audit_log.rb +0 -36
- data/lib/lib_discord/auto_moderation.rb +0 -106
- data/lib/lib_discord/channel.rb +0 -716
- data/lib/lib_discord/emoji.rb +0 -106
- data/lib/lib_discord/errors.rb +0 -31
- data/lib/lib_discord/guild.rb +0 -830
- data/lib/lib_discord/guild_scheduled_event.rb +0 -133
- data/lib/lib_discord/guild_template.rb +0 -128
- data/lib/lib_discord/interaction.rb +0 -163
- data/lib/lib_discord/invite.rb +0 -47
- data/lib/lib_discord/mappers/application_command_option_types.rb +0 -22
- data/lib/lib_discord/mappers/application_command_permission_types.rb +0 -14
- data/lib/lib_discord/mappers/application_command_types.rb +0 -14
- data/lib/lib_discord/mappers/application_integration_types.rb +0 -13
- data/lib/lib_discord/mappers/application_role_connection_metadata_types.rb +0 -19
- data/lib/lib_discord/mappers/audit_log_events.rb +0 -67
- data/lib/lib_discord/mappers/auto_moderation_action_types.rb +0 -14
- data/lib/lib_discord/mappers/auto_moderation_event_types.rb +0 -12
- data/lib/lib_discord/mappers/auto_moderation_keyword_preset_types.rb +0 -14
- data/lib/lib_discord/mappers/auto_moderation_trigger_types.rb +0 -15
- data/lib/lib_discord/mappers/channel_forum_layout_types.rb +0 -14
- data/lib/lib_discord/mappers/channel_message_activity_types.rb +0 -15
- data/lib/lib_discord/mappers/channel_message_types.rb +0 -42
- data/lib/lib_discord/mappers/channel_sort_order_types.rb +0 -13
- data/lib/lib_discord/mappers/channel_types.rb +0 -24
- data/lib/lib_discord/mappers/channel_video_quality_modes.rb +0 -13
- data/lib/lib_discord/mappers/guild_default_message_notification_levels.rb +0 -13
- data/lib/lib_discord/mappers/guild_explicit_content_filter_levels.rb +0 -14
- data/lib/lib_discord/mappers/guild_integration_expire_behaviors.rb +0 -13
- data/lib/lib_discord/mappers/guild_mfa_levels.rb +0 -13
- data/lib/lib_discord/mappers/guild_nsfw_levels.rb +0 -15
- data/lib/lib_discord/mappers/guild_onboarding_modes.rb +0 -13
- data/lib/lib_discord/mappers/guild_premium_tiers.rb +0 -15
- data/lib/lib_discord/mappers/guild_prompt_types.rb +0 -13
- data/lib/lib_discord/mappers/guild_scheduled_event_entity_types.rb +0 -14
- data/lib/lib_discord/mappers/guild_scheduled_event_privacy_levels.rb +0 -12
- data/lib/lib_discord/mappers/guild_scheduled_event_statuses.rb +0 -15
- data/lib/lib_discord/mappers/guild_verification_levels.rb +0 -16
- data/lib/lib_discord/mappers/interaction_callback_types.rb +0 -19
- data/lib/lib_discord/mappers/interaction_context_types.rb +0 -14
- data/lib/lib_discord/mappers/interaction_types.rb +0 -16
- data/lib/lib_discord/mappers/invite_target_types.rb +0 -13
- data/lib/lib_discord/mappers/message_component_button_styles.rb +0 -16
- data/lib/lib_discord/mappers/message_component_text_input_styles.rb +0 -13
- data/lib/lib_discord/mappers/message_component_types.rb +0 -19
- data/lib/lib_discord/mappers/poll_layout_types.rb +0 -12
- data/lib/lib_discord/mappers/stage_instance_privacy_levels.rb +0 -13
- data/lib/lib_discord/mappers/sticker_format_types.rb +0 -15
- data/lib/lib_discord/mappers/sticker_types.rb +0 -13
- data/lib/lib_discord/mappers/user_premium_types.rb +0 -15
- data/lib/lib_discord/mappers/user_visibility_types.rb +0 -13
- data/lib/lib_discord/mappers/webhooks_types.rb +0 -14
- data/lib/lib_discord/mappers.rb +0 -87
- data/lib/lib_discord/poll.rb +0 -62
- data/lib/lib_discord/resource.rb +0 -133
- data/lib/lib_discord/response.rb +0 -43
- data/lib/lib_discord/stage_instance.rb +0 -79
- data/lib/lib_discord/sticker.rb +0 -132
- data/lib/lib_discord/types.rb +0 -47
- data/lib/lib_discord/user.rb +0 -174
- data/lib/lib_discord/voice.rb +0 -29
- data/lib/lib_discord/webhook.rb +0 -299
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LibDiscord
|
4
|
+
# @api private
|
5
|
+
PERMISSIONS = {
|
6
|
+
CREATE_INSTANT_INVITE: 1 << 0,
|
7
|
+
KICK_MEMBERS: 1 << 1,
|
8
|
+
BAN_MEMBERS: 1 << 2,
|
9
|
+
ADMINISTRATOR: 1 << 3,
|
10
|
+
MANAGE_CHANNELS: 1 << 4,
|
11
|
+
MANAGE_GUILD: 1 << 5,
|
12
|
+
ADD_REACTIONS: 1 << 6,
|
13
|
+
VIEW_AUDIT_LOG: 1 << 7,
|
14
|
+
PRIORITY_SPEAKER: 1 << 8,
|
15
|
+
STREAM: 1 << 9,
|
16
|
+
VIEW_CHANNEL: 1 << 10,
|
17
|
+
SEND_MESSAGES: 1 << 11,
|
18
|
+
SEND_TTS_MESSAGES: 1 << 12,
|
19
|
+
MANAGE_MESSAGES: 1 << 13,
|
20
|
+
EMBED_LINKS: 1 << 14,
|
21
|
+
ATTACH_FILES: 1 << 15,
|
22
|
+
READ_MESSAGE_HISTORY: 1 << 16,
|
23
|
+
MENTION_EVERYONE: 1 << 17,
|
24
|
+
USE_EXTERNAL_EMOJIS: 1 << 18,
|
25
|
+
VIEW_GUILD_INSIGHTS: 1 << 19,
|
26
|
+
CONNECT: 1 << 20,
|
27
|
+
SPEAK: 1 << 21,
|
28
|
+
MUTE_MEMBERS: 1 << 22,
|
29
|
+
DEAFEN_MEMBERS: 1 << 23,
|
30
|
+
MOVE_MEMBERS: 1 << 24,
|
31
|
+
USE_VAD: 1 << 25,
|
32
|
+
CHANGE_NICKNAME: 1 << 26,
|
33
|
+
MANAGE_NICKNAMES: 1 << 27,
|
34
|
+
MANAGE_ROLES: 1 << 28,
|
35
|
+
MANAGE_WEBHOOKS: 1 << 29,
|
36
|
+
MANAGE_GUILD_EXPRESSIONS: 1 << 30,
|
37
|
+
USE_APPLICATION_COMMANDS: 1 << 31,
|
38
|
+
REQUEST_TO_SPEAK: 1 << 32,
|
39
|
+
MANAGE_EVENTS: 1 << 33,
|
40
|
+
MANAGE_THREADS: 1 << 34,
|
41
|
+
CREATE_PUBLIC_THREADS: 1 << 35,
|
42
|
+
CREATE_PRIVATE_THREADS: 1 << 36,
|
43
|
+
USE_EXTERNAL_STICKERS: 1 << 37,
|
44
|
+
SEND_MESSAGES_IN_THREADS: 1 << 38,
|
45
|
+
USE_EMBEDDED_ACTIVITIES: 1 << 39,
|
46
|
+
MODERATE_MEMBERS: 1 << 40,
|
47
|
+
VIEW_CREATOR_MONETIZATION_ANALYTICS: 1 << 41,
|
48
|
+
USE_SOUNDBOARD: 1 << 42,
|
49
|
+
CREATE_GUILD_EXPRESSIONS: 1 << 43,
|
50
|
+
CREATE_EVENTS: 1 << 44,
|
51
|
+
USE_EXTERNAL_SOUNDS: 1 << 45,
|
52
|
+
SEND_VOICE_MESSAGES: 1 << 46,
|
53
|
+
SEND_POLLS: 1 << 49,
|
54
|
+
USE_EXTERNAL_APPS: 1 << 50
|
55
|
+
}.freeze
|
56
|
+
|
57
|
+
##
|
58
|
+
# Get the data structure for Discord permissions. Use this data structure for
|
59
|
+
# permissions calculations, permissions comparisons, and to help reduce magic
|
60
|
+
# numbers in your code when making requests to Discord and parsing Discord
|
61
|
+
# responses.
|
62
|
+
#
|
63
|
+
# @return [Hash{Symbol => Integer}]
|
64
|
+
#
|
65
|
+
# @example
|
66
|
+
# p = LibDiscord.permissions
|
67
|
+
# p[:ADD_REACTIONS] # => 64
|
68
|
+
#
|
69
|
+
# @example Permissions value that can SEND_MESSAGES and ADD_REACTIONS
|
70
|
+
# my_perms = p[:SEND_MESSAGES] + p[:ADD_REACTIONS] # => 2112
|
71
|
+
#
|
72
|
+
# @example Check for permission flags that are set.
|
73
|
+
# my_perms & p[:ADD_REACTIONS] == p[:ADD_REACTIONS] # => true
|
74
|
+
#
|
75
|
+
# @example Check for permission flags that are not set.
|
76
|
+
# my_perms & p[:KICK_MEMBERS] == p[:KICK_MEMBERS] # => false
|
77
|
+
#
|
78
|
+
# @see https://docs.ruby-lang.org/en/3.3/Integer.html#method-i-26 Integer
|
79
|
+
# bitwise AND
|
80
|
+
# @see https://en.wikipedia.org/wiki/Magic_number_(programming) Wikipedia -
|
81
|
+
# Magic number (programming)
|
82
|
+
# @see https://discord.com/developers/docs/topics/permissions Discord
|
83
|
+
# documentation "Permissions"
|
84
|
+
def self.permissions = PERMISSIONS
|
85
|
+
end
|
data/lib/lib_discord/urls.rb
CHANGED
@@ -1,27 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module LibDiscord
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
# @api private
|
5
|
+
DISCORD_BASE_URL = "https://discord.com"
|
6
|
+
|
7
7
|
# @api private
|
8
8
|
PROJECT_URL = "https://sr.ht/~komidore64/lib_discord"
|
9
9
|
|
10
|
-
##
|
11
|
-
# Source code URL
|
12
|
-
#
|
13
10
|
# @api private
|
14
11
|
SOURCE_URL = "https://git.sr.ht/~komidore64/lib_discord"
|
15
12
|
|
16
|
-
##
|
17
|
-
# Bug tracker URL
|
18
|
-
#
|
19
13
|
# @api private
|
20
14
|
BUG_TRACKER_URL = "https://todo.sr.ht/~komidore64/lib_discord"
|
21
15
|
|
22
|
-
##
|
23
|
-
# Mailing list URLs
|
24
|
-
#
|
25
16
|
# @api private
|
26
17
|
MAILING_LIST_URL = "https://sr.ht/~komidore64/lib_discord/lists"
|
27
18
|
end
|
data/lib/lib_discord/version.rb
CHANGED
data/lib/lib_discord.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
##
|
4
|
-
# Module to namespace all LibDiscord classes, constants, types, etc.
|
5
|
-
module LibDiscord; end
|
6
|
-
|
7
3
|
require "lib_discord/client"
|
8
|
-
require "lib_discord/
|
4
|
+
require "lib_discord/formatter"
|
5
|
+
require "lib_discord/maps"
|
6
|
+
require "lib_discord/permissions"
|
metadata
CHANGED
@@ -1,31 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lib_discord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Price
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-06-05 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.11'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.11'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: dry-struct
|
13
|
+
name: logger
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
30
15
|
requirements:
|
31
16
|
- - "~>"
|
@@ -38,115 +23,23 @@ dependencies:
|
|
38
23
|
- - "~>"
|
39
24
|
- !ruby/object:Gem::Version
|
40
25
|
version: '1.6'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: dry-types
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.7'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.7'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: http
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '5.1'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '5.1'
|
69
|
-
description:
|
70
26
|
email:
|
71
27
|
- komidore64@gmail.com
|
72
28
|
executables: []
|
73
29
|
extensions: []
|
74
30
|
extra_rdoc_files: []
|
75
31
|
files:
|
76
|
-
- CHANGELOG.md
|
77
32
|
- CODE_OF_CONDUCT.md
|
33
|
+
- CONTRIBUTING.md
|
78
34
|
- LICENSES/AGPL-3.0-only.txt
|
79
35
|
- README.md
|
80
36
|
- lib/lib_discord.rb
|
81
|
-
- lib/lib_discord/application.rb
|
82
|
-
- lib/lib_discord/application_command.rb
|
83
|
-
- lib/lib_discord/application_role_connection_metadata.rb
|
84
|
-
- lib/lib_discord/audit_log.rb
|
85
|
-
- lib/lib_discord/auto_moderation.rb
|
86
|
-
- lib/lib_discord/channel.rb
|
87
37
|
- lib/lib_discord/client.rb
|
88
|
-
- lib/lib_discord/
|
89
|
-
- lib/lib_discord/
|
90
|
-
- lib/lib_discord/
|
91
|
-
- lib/lib_discord/guild_scheduled_event.rb
|
92
|
-
- lib/lib_discord/guild_template.rb
|
93
|
-
- lib/lib_discord/interaction.rb
|
94
|
-
- lib/lib_discord/invite.rb
|
95
|
-
- lib/lib_discord/mappers.rb
|
96
|
-
- lib/lib_discord/mappers/application_command_option_types.rb
|
97
|
-
- lib/lib_discord/mappers/application_command_permission_types.rb
|
98
|
-
- lib/lib_discord/mappers/application_command_types.rb
|
99
|
-
- lib/lib_discord/mappers/application_integration_types.rb
|
100
|
-
- lib/lib_discord/mappers/application_role_connection_metadata_types.rb
|
101
|
-
- lib/lib_discord/mappers/audit_log_events.rb
|
102
|
-
- lib/lib_discord/mappers/auto_moderation_action_types.rb
|
103
|
-
- lib/lib_discord/mappers/auto_moderation_event_types.rb
|
104
|
-
- lib/lib_discord/mappers/auto_moderation_keyword_preset_types.rb
|
105
|
-
- lib/lib_discord/mappers/auto_moderation_trigger_types.rb
|
106
|
-
- lib/lib_discord/mappers/channel_forum_layout_types.rb
|
107
|
-
- lib/lib_discord/mappers/channel_message_activity_types.rb
|
108
|
-
- lib/lib_discord/mappers/channel_message_types.rb
|
109
|
-
- lib/lib_discord/mappers/channel_sort_order_types.rb
|
110
|
-
- lib/lib_discord/mappers/channel_types.rb
|
111
|
-
- lib/lib_discord/mappers/channel_video_quality_modes.rb
|
112
|
-
- lib/lib_discord/mappers/guild_default_message_notification_levels.rb
|
113
|
-
- lib/lib_discord/mappers/guild_explicit_content_filter_levels.rb
|
114
|
-
- lib/lib_discord/mappers/guild_integration_expire_behaviors.rb
|
115
|
-
- lib/lib_discord/mappers/guild_mfa_levels.rb
|
116
|
-
- lib/lib_discord/mappers/guild_nsfw_levels.rb
|
117
|
-
- lib/lib_discord/mappers/guild_onboarding_modes.rb
|
118
|
-
- lib/lib_discord/mappers/guild_premium_tiers.rb
|
119
|
-
- lib/lib_discord/mappers/guild_prompt_types.rb
|
120
|
-
- lib/lib_discord/mappers/guild_scheduled_event_entity_types.rb
|
121
|
-
- lib/lib_discord/mappers/guild_scheduled_event_privacy_levels.rb
|
122
|
-
- lib/lib_discord/mappers/guild_scheduled_event_statuses.rb
|
123
|
-
- lib/lib_discord/mappers/guild_verification_levels.rb
|
124
|
-
- lib/lib_discord/mappers/interaction_callback_types.rb
|
125
|
-
- lib/lib_discord/mappers/interaction_context_types.rb
|
126
|
-
- lib/lib_discord/mappers/interaction_types.rb
|
127
|
-
- lib/lib_discord/mappers/invite_target_types.rb
|
128
|
-
- lib/lib_discord/mappers/message_component_button_styles.rb
|
129
|
-
- lib/lib_discord/mappers/message_component_text_input_styles.rb
|
130
|
-
- lib/lib_discord/mappers/message_component_types.rb
|
131
|
-
- lib/lib_discord/mappers/poll_layout_types.rb
|
132
|
-
- lib/lib_discord/mappers/stage_instance_privacy_levels.rb
|
133
|
-
- lib/lib_discord/mappers/sticker_format_types.rb
|
134
|
-
- lib/lib_discord/mappers/sticker_types.rb
|
135
|
-
- lib/lib_discord/mappers/user_premium_types.rb
|
136
|
-
- lib/lib_discord/mappers/user_visibility_types.rb
|
137
|
-
- lib/lib_discord/mappers/webhooks_types.rb
|
138
|
-
- lib/lib_discord/poll.rb
|
139
|
-
- lib/lib_discord/resource.rb
|
140
|
-
- lib/lib_discord/response.rb
|
141
|
-
- lib/lib_discord/stage_instance.rb
|
142
|
-
- lib/lib_discord/sticker.rb
|
143
|
-
- lib/lib_discord/types.rb
|
38
|
+
- lib/lib_discord/formatter.rb
|
39
|
+
- lib/lib_discord/maps.rb
|
40
|
+
- lib/lib_discord/permissions.rb
|
144
41
|
- lib/lib_discord/urls.rb
|
145
|
-
- lib/lib_discord/user.rb
|
146
42
|
- lib/lib_discord/version.rb
|
147
|
-
- lib/lib_discord/voice.rb
|
148
|
-
- lib/lib_discord/webhook.rb
|
149
|
-
homepage:
|
150
43
|
licenses:
|
151
44
|
- AGPL-3.0-only
|
152
45
|
metadata:
|
@@ -155,7 +48,6 @@ metadata:
|
|
155
48
|
homepage_uri: https://sr.ht/~komidore64/lib_discord
|
156
49
|
mailing_list_uri: https://sr.ht/~komidore64/lib_discord/lists
|
157
50
|
source_code_uri: https://git.sr.ht/~komidore64/lib_discord
|
158
|
-
post_install_message:
|
159
51
|
rdoc_options: []
|
160
52
|
require_paths:
|
161
53
|
- lib
|
@@ -163,15 +55,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
55
|
requirements:
|
164
56
|
- - ">="
|
165
57
|
- !ruby/object:Gem::Version
|
166
|
-
version: '3.
|
58
|
+
version: '3.3'
|
167
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
60
|
requirements:
|
169
61
|
- - ">="
|
170
62
|
- !ruby/object:Gem::Version
|
171
63
|
version: '0'
|
172
64
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
174
|
-
signing_key:
|
65
|
+
rubygems_version: 3.6.2
|
175
66
|
specification_version: 4
|
176
|
-
summary:
|
67
|
+
summary: Straightforward Discord Web API bindings
|
177
68
|
test_files: []
|
data/CHANGELOG.md
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
# CHANGELOG
|
2
|
-
|
3
|
-
## [0.1.2] - 2024-05-13
|
4
|
-
|
5
|
-
### chore
|
6
|
-
- sort modules alphabetically
|
7
|
-
- unified error raising style
|
8
|
-
- bump version to 0.1.2
|
9
|
-
|
10
|
-
### fix
|
11
|
-
- allow for loggers other than Logger descendants
|
12
|
-
- forgot how to raise errors :facepalm:
|
13
|
-
- arguments for ConstraintError
|
14
|
-
- use `#debug()` convenience method rather than `#add()`
|
15
|
-
|
16
|
-
## [0.1.1] - 2024-04-24
|
17
|
-
|
18
|
-
### chore
|
19
|
-
- Revert "fix: remove gem version badge"
|
20
|
-
- include additional files for yardoc
|
21
|
-
- bump version to 0.1.1
|
22
|
-
|
23
|
-
### fix
|
24
|
-
- remove gem version badge
|
25
|
-
- name dry-container keys correctly
|
26
|
-
|
27
|
-
## [0.1.0] - 2024-04-24
|
28
|
-
|
29
|
-
### chore
|
30
|
-
- generate CHANGELOG.md
|
31
|
-
- typo fix
|
32
|
-
- use `standard` gem rather than `standardrb` alias
|
33
|
-
- shields always make a project cooler
|
34
|
-
- move resources into the lib_discord dir
|
35
|
-
- add yardoc for application
|
36
|
-
- yardoc for application_command
|
37
|
-
- yardoc for application_role_connection_metadata
|
38
|
-
- yardoc for audit_log
|
39
|
-
- yardoc for auto_moderation
|
40
|
-
- yardoc for channel
|
41
|
-
- yardoc for emoji
|
42
|
-
- yardoc for guild
|
43
|
-
- yardoc for guild_scheduled_event and guild_template
|
44
|
-
- yardoc for stage_instance
|
45
|
-
- yardoc for sticker
|
46
|
-
- yardoc for user
|
47
|
-
- yardoc for voice
|
48
|
-
- yardoc for webhook
|
49
|
-
- finish yardoc
|
50
|
-
- add changelog to generated yardoc
|
51
|
-
- note all the parameters that are discord snowflakes
|
52
|
-
- reduce line length to 80 columns, where it makes sense
|
53
|
-
- application-commands - copy descriptions
|
54
|
-
- application - copy descriptions
|
55
|
-
- interactions - copy descriptions
|
56
|
-
- application-role-connection-metadata - copy descriptions
|
57
|
-
- let's leave the endpoint descriptions to Discord
|
58
|
-
- use our binstubs
|
59
|
-
- document the mappers module
|
60
|
-
|
61
|
-
### feat
|
62
|
-
- polls came out since i started working on this library!
|
63
|
-
- [**breaking**] authorization header for client is now a positional argument
|
64
|
-
- account for endpoints that don't require auth
|
65
|
-
- add convenience constants for discord integer encodings
|
66
|
-
- bump to version 0.1.0
|
67
|
-
|
68
|
-
### fix
|
69
|
-
- bad yardoc
|
70
|
-
- incorrect ruby-object `#inspect` output in documentation
|
71
|
-
|
72
|
-
## [0.1.0.pre2] - 2024-04-15
|
73
|
-
|
74
|
-
### chore
|
75
|
-
- generate CHANGELOG.md
|
76
|
-
- bump version to 0.1.0.pre2
|
77
|
-
|
78
|
-
### fix
|
79
|
-
- let's not leak Discord Bot Tokens to stdout
|
80
|
-
|
81
|
-
## [0.1.0.pre] - 2024-04-15
|
82
|
-
|
83
|
-
### chore
|
84
|
-
- initial rspec scaffold
|
85
|
-
- move shared_examples into a single file
|
86
|
-
- add code coverage reporting
|
87
|
-
- mark development dependencies as such
|
88
|
-
- don't test HTTP if we don't need to
|
89
|
-
- make sure we can do non-200 responses
|
90
|
-
- yard and debug version contraints
|
91
|
-
- add standardrb tooling
|
92
|
-
- add sourcehut build manifest
|
93
|
-
- add coverage reports to builds.sr.ht artifact list
|
94
|
-
- remove unused fixture tooling
|
95
|
-
|
96
|
-
### feat
|
97
|
-
- finish guild
|
98
|
-
- add guild_scheduled_event
|
99
|
-
- empty files for the rest of the resources
|
100
|
-
- add invites
|
101
|
-
- add stage instance endpoints
|
102
|
-
- add sticker endpoints
|
103
|
-
- add user endpoints
|
104
|
-
- add voice endpoints
|
105
|
-
- add webhook endpoints
|
106
|
-
- more rspec scaffolding
|
107
|
-
- basic tests for application resource
|
108
|
-
- add application_role_connection_metadata_spec
|
109
|
-
- add audit_log_spec
|
110
|
-
- add auto_moderation_spec
|
111
|
-
- more test scaffolding
|
112
|
-
- finished channel_spec
|
113
|
-
- fill out emoji_spec
|
114
|
-
- fill out guild_scheduled_event_spec
|
115
|
-
- fill out guild_spec and guild_template_spec
|
116
|
-
- fill out invite_spec and stage_instance_spec
|
117
|
-
- fill out sticker_spec
|
118
|
-
- fill out user_spec and voice_spec
|
119
|
-
- fill out webhook_spec
|
120
|
-
- make sure the client can access all resources
|
121
|
-
- add fixture support
|
122
|
-
- expose the container via delegators
|
123
|
-
- implement `#send_request` for Resource
|
124
|
-
- discord requests that we provide a user-agent
|
125
|
-
- introduce type checking for our inputs
|
126
|
-
- include query parameters for endpoints
|
127
|
-
- add interaction resource and interaction_spec
|
128
|
-
- add application_command and application_command_spec
|
129
|
-
- use custom matcher for lib_discord/response struct
|
130
|
-
- add a logger into the system
|
131
|
-
- test resource logging when mime-type is unknown
|
132
|
-
- update readme and ancillary documents
|
133
|
-
- add git-cliff for changelog generation
|
134
|
-
|
135
|
-
### fix
|
136
|
-
- i missed a bunch of guild endpoints
|
137
|
-
- ensure we're testing all the code
|
138
|
-
- contain the abstraction if HTTP throws an error
|
139
|
-
|
140
|
-
---
|
141
|
-
|
142
|
-
generated by [git-cliff](https://git-cliff.org/)
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
##
|
7
|
-
# Application Resource
|
8
|
-
#
|
9
|
-
# Do not instantiate an {Application} directly. Instead request one from an
|
10
|
-
# instance of {Client}.
|
11
|
-
#
|
12
|
-
# client = LibDiscord::Client.new("Bot auth.token")
|
13
|
-
# a = client["application"]
|
14
|
-
#
|
15
|
-
# @see https://discord.com/developers/docs/resources/application Discord
|
16
|
-
# documentation "Application Resource"
|
17
|
-
class Application < Resource
|
18
|
-
##
|
19
|
-
# @return [Response]
|
20
|
-
#
|
21
|
-
# @raise [TimeoutError] if the HTTP request times out
|
22
|
-
#
|
23
|
-
# @see https://discord.com/developers/docs/resources/application#get-current-application
|
24
|
-
# Discord documentation "Get Current Application"
|
25
|
-
def get_current_application
|
26
|
-
send_request(:get, "/applications/@me")
|
27
|
-
end
|
28
|
-
|
29
|
-
##
|
30
|
-
# @param json [Hash] JSON serializable payload
|
31
|
-
#
|
32
|
-
# @return [Response]
|
33
|
-
#
|
34
|
-
# @raise [TimeoutError] if the HTTP request times out
|
35
|
-
# @raise [ConstraintError] if +json+ cannot be serialized to JSON
|
36
|
-
#
|
37
|
-
# @see https://discord.com/developers/docs/resources/application#edit-current-application
|
38
|
-
# Discord documentation "Edit Current Application"
|
39
|
-
def edit_current_application(json:)
|
40
|
-
send_request(:patch, "/applications/@me", json:)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|