lib_discord 0.1.0.pre2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lib_discord/application.rb +43 -0
- data/lib/lib_discord/application_command.rb +341 -0
- data/lib/lib_discord/application_role_connection_metadata.rb +52 -0
- data/lib/lib_discord/audit_log.rb +36 -0
- data/lib/lib_discord/auto_moderation.rb +106 -0
- data/lib/lib_discord/channel.rb +716 -0
- data/lib/lib_discord/client.rb +124 -14
- data/lib/lib_discord/emoji.rb +106 -0
- data/lib/lib_discord/errors.rb +24 -0
- data/lib/lib_discord/guild.rb +830 -0
- data/lib/lib_discord/guild_scheduled_event.rb +133 -0
- data/lib/lib_discord/guild_template.rb +128 -0
- data/lib/lib_discord/interaction.rb +163 -0
- data/lib/lib_discord/invite.rb +47 -0
- data/lib/lib_discord/mappers/application_command_option_types.rb +22 -0
- data/lib/lib_discord/mappers/application_command_permission_types.rb +14 -0
- data/lib/lib_discord/mappers/application_command_types.rb +14 -0
- data/lib/lib_discord/mappers/application_integration_types.rb +13 -0
- data/lib/lib_discord/mappers/application_role_connection_metadata_types.rb +19 -0
- data/lib/lib_discord/mappers/audit_log_events.rb +67 -0
- data/lib/lib_discord/mappers/auto_moderation_action_types.rb +14 -0
- data/lib/lib_discord/mappers/auto_moderation_event_types.rb +12 -0
- data/lib/lib_discord/mappers/auto_moderation_keyword_preset_types.rb +14 -0
- data/lib/lib_discord/mappers/auto_moderation_trigger_types.rb +15 -0
- data/lib/lib_discord/mappers/channel_forum_layout_types.rb +14 -0
- data/lib/lib_discord/mappers/channel_message_activity_types.rb +15 -0
- data/lib/lib_discord/mappers/channel_message_types.rb +42 -0
- data/lib/lib_discord/mappers/channel_sort_order_types.rb +13 -0
- data/lib/lib_discord/mappers/channel_types.rb +24 -0
- data/lib/lib_discord/mappers/channel_video_quality_modes.rb +13 -0
- data/lib/lib_discord/mappers/guild_default_message_notification_levels.rb +13 -0
- data/lib/lib_discord/mappers/guild_explicit_content_filter_levels.rb +14 -0
- data/lib/lib_discord/mappers/guild_integration_expire_behaviors.rb +13 -0
- data/lib/lib_discord/mappers/guild_mfa_levels.rb +13 -0
- data/lib/lib_discord/mappers/guild_nsfw_levels.rb +15 -0
- data/lib/lib_discord/mappers/guild_onboarding_modes.rb +13 -0
- data/lib/lib_discord/mappers/guild_premium_tiers.rb +15 -0
- data/lib/lib_discord/mappers/guild_prompt_types.rb +13 -0
- data/lib/lib_discord/mappers/guild_scheduled_event_entity_types.rb +14 -0
- data/lib/lib_discord/mappers/guild_scheduled_event_privacy_levels.rb +12 -0
- data/lib/lib_discord/mappers/guild_scheduled_event_statuses.rb +15 -0
- data/lib/lib_discord/mappers/guild_verification_levels.rb +16 -0
- data/lib/lib_discord/mappers/interaction_callback_types.rb +19 -0
- data/lib/lib_discord/mappers/interaction_context_types.rb +14 -0
- data/lib/lib_discord/mappers/interaction_types.rb +16 -0
- data/lib/lib_discord/mappers/invite_target_types.rb +13 -0
- data/lib/lib_discord/mappers/message_component_button_styles.rb +16 -0
- data/lib/lib_discord/mappers/message_component_text_input_styles.rb +13 -0
- data/lib/lib_discord/mappers/message_component_types.rb +19 -0
- data/lib/lib_discord/mappers/poll_layout_types.rb +12 -0
- data/lib/lib_discord/mappers/stage_instance_privacy_levels.rb +13 -0
- data/lib/lib_discord/mappers/sticker_format_types.rb +15 -0
- data/lib/lib_discord/mappers/sticker_types.rb +13 -0
- data/lib/lib_discord/mappers/user_premium_types.rb +15 -0
- data/lib/lib_discord/mappers/user_visibility_types.rb +13 -0
- data/lib/lib_discord/mappers/webhooks_types.rb +14 -0
- data/lib/lib_discord/mappers.rb +87 -0
- data/lib/lib_discord/poll.rb +62 -0
- data/lib/lib_discord/resource.rb +91 -21
- data/lib/lib_discord/response.rb +39 -7
- data/lib/lib_discord/stage_instance.rb +79 -0
- data/lib/lib_discord/sticker.rb +132 -0
- data/lib/lib_discord/types.rb +35 -11
- data/lib/lib_discord/urls.rb +20 -12
- data/lib/lib_discord/user.rb +174 -0
- data/lib/lib_discord/version.rb +5 -1
- data/lib/lib_discord/voice.rb +29 -0
- data/lib/lib_discord/webhook.rb +299 -0
- data/lib/lib_discord.rb +5 -0
- metadata +77 -20
- data/lib/lib_discord/resources/application.rb +0 -15
- data/lib/lib_discord/resources/application_command.rb +0 -71
- data/lib/lib_discord/resources/application_role_connection_metadata.rb +0 -15
- data/lib/lib_discord/resources/audit_log.rb +0 -11
- data/lib/lib_discord/resources/auto_moderation.rb +0 -27
- data/lib/lib_discord/resources/channel.rb +0 -168
- data/lib/lib_discord/resources/emoji.rb +0 -27
- data/lib/lib_discord/resources/guild.rb +0 -196
- data/lib/lib_discord/resources/guild_scheduled_event.rb +0 -31
- data/lib/lib_discord/resources/guild_template.rb +0 -35
- data/lib/lib_discord/resources/interaction.rb +0 -39
- data/lib/lib_discord/resources/invite.rb +0 -15
- data/lib/lib_discord/resources/stage_instance.rb +0 -23
- data/lib/lib_discord/resources/sticker.rb +0 -35
- data/lib/lib_discord/resources/user.rb +0 -51
- data/lib/lib_discord/resources/voice.rb +0 -11
- data/lib/lib_discord/resources/webhook.rb +0 -67
- data/lib/lib_discord/resources.rb +0 -19
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class ApplicationCommand < Resource
|
7
|
-
def get_global_application_commands(application_id:, params: {})
|
8
|
-
send_request(:get, "/applications/#{application_id}/commands", params:)
|
9
|
-
end
|
10
|
-
|
11
|
-
def create_global_application_command(application_id:, json:)
|
12
|
-
send_request(:post, "/applications/#{application_id}/commands", json:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_global_application_command(application_id:, command_id:)
|
16
|
-
send_request(:get, "/applications/#{application_id}/commands/#{command_id}")
|
17
|
-
end
|
18
|
-
|
19
|
-
def edit_global_application_command(application_id:, command_id:, json:)
|
20
|
-
send_request(:patch, "/applications/#{application_id}/commands/#{command_id}", json:)
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete_global_application_command(application_id:, command_id:)
|
24
|
-
send_request(:delete, "/applications/#{application_id}/commands/#{command_id}")
|
25
|
-
end
|
26
|
-
|
27
|
-
def bulk_overwrite_global_application_commands(application_id:, json:)
|
28
|
-
send_request(:put, "/applications/#{application_id}/commands", json:)
|
29
|
-
end
|
30
|
-
|
31
|
-
def get_guild_application_commands(application_id:, guild_id:, params: {})
|
32
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands", params:)
|
33
|
-
end
|
34
|
-
|
35
|
-
def create_guild_application_command(application_id:, guild_id:, json:)
|
36
|
-
send_request(:post, "/applications/#{application_id}/guilds/#{guild_id}/commands", json:)
|
37
|
-
end
|
38
|
-
|
39
|
-
def get_guild_application_command(application_id:, guild_id:, command_id:)
|
40
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}")
|
41
|
-
end
|
42
|
-
|
43
|
-
def edit_guild_application_command(application_id:, guild_id:, command_id:, json:)
|
44
|
-
send_request(:patch, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}", json:)
|
45
|
-
end
|
46
|
-
|
47
|
-
def delete_guild_application_command(application_id:, guild_id:, command_id:)
|
48
|
-
send_request(:delete, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}")
|
49
|
-
end
|
50
|
-
|
51
|
-
def bulk_overwrite_guild_application_commands(application_id:, guild_id:, json:)
|
52
|
-
send_request(:put, "/applications/#{application_id}/guilds/#{guild_id}/commands", json:)
|
53
|
-
end
|
54
|
-
|
55
|
-
def get_guild_application_command_permissions(application_id:, guild_id:)
|
56
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands/permissions")
|
57
|
-
end
|
58
|
-
|
59
|
-
def get_application_command_permissions(application_id:, guild_id:, command_id:)
|
60
|
-
send_request(:get, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions")
|
61
|
-
end
|
62
|
-
|
63
|
-
def edit_application_command_permissions(application_id:, guild_id:, command_id:, json:)
|
64
|
-
send_request(:put, "/applications/#{application_id}/guilds/#{guild_id}/commands/#{command_id}/permissions", json:)
|
65
|
-
end
|
66
|
-
|
67
|
-
def batch_edit_application_command_permissions(application_id:, guild_id:, json:)
|
68
|
-
send_request(:put, "/applications/#{application_id}/guilds/#{guild_id}/commands/permissions", json:)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class ApplicationRoleConnectionMetadata < Resource
|
7
|
-
def get_application_role_connection_metadata_records(application_id:)
|
8
|
-
send_request(:get, "/applications/#{application_id}/role-connections/metadata")
|
9
|
-
end
|
10
|
-
|
11
|
-
def update_application_role_connection_metadata_records(application_id:, json:)
|
12
|
-
send_request(:put, "/applications/#{application_id}/role-connections/metadata", json:)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class AutoModeration < Resource
|
7
|
-
def list_auto_moderation_rules_for_guild(guild_id:)
|
8
|
-
send_request(:get, "/guilds/#{guild_id}/auto-moderation/rules")
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_auto_moderation_rule(guild_id:, auto_moderation_rule_id:)
|
12
|
-
send_request(:get, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}")
|
13
|
-
end
|
14
|
-
|
15
|
-
def create_auto_moderation_rule(guild_id:, json:)
|
16
|
-
send_request(:post, "/guilds/#{guild_id}/auto-moderation/rules", json:)
|
17
|
-
end
|
18
|
-
|
19
|
-
def modify_auto_moderation_rule(guild_id:, auto_moderation_rule_id:, json:)
|
20
|
-
send_request(:patch, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}", json:)
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete_auto_moderation_rule(guild_id:, auto_moderation_rule_id:)
|
24
|
-
send_request(:delete, "/guilds/#{guild_id}/auto-moderation/rules/#{auto_moderation_rule_id}")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,168 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class Channel < Resource
|
7
|
-
def get_channel(channel_id:)
|
8
|
-
send_request(:get, "/channels/#{channel_id}")
|
9
|
-
end
|
10
|
-
|
11
|
-
def modify_channel(channel_id:, json:)
|
12
|
-
send_request(:patch, "/channels/#{channel_id}", json:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def delete_channel(channel_id:)
|
16
|
-
send_request(:delete, "/channels/#{channel_id}")
|
17
|
-
end
|
18
|
-
|
19
|
-
alias_method :close_channel, :delete_channel
|
20
|
-
|
21
|
-
def get_channel_messages(channel_id:, params: {})
|
22
|
-
send_request(:get, "/channels/#{channel_id}/messages", params:)
|
23
|
-
end
|
24
|
-
|
25
|
-
def get_channel_message(channel_id:, message_id:)
|
26
|
-
send_request(:get, "/channels/#{channel_id}/messages/#{message_id}")
|
27
|
-
end
|
28
|
-
|
29
|
-
def create_message(channel_id:, json:)
|
30
|
-
send_request(:post, "/channels/#{channel_id}/messages", json:)
|
31
|
-
end
|
32
|
-
|
33
|
-
def crosspost_message(channel_id:, message_id:)
|
34
|
-
send_request(:post, "/channels/#{channel_id}/messages/#{message_id}/crosspost")
|
35
|
-
end
|
36
|
-
|
37
|
-
def create_reaction(channel_id:, message_id:, emoji:)
|
38
|
-
send_request(:put, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me")
|
39
|
-
end
|
40
|
-
|
41
|
-
def delete_own_reaction(channel_id:, message_id:, emoji:)
|
42
|
-
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me")
|
43
|
-
end
|
44
|
-
|
45
|
-
def delete_user_reaction(channel_id:, message_id:, emoji:, user_id:)
|
46
|
-
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/#{user_id}")
|
47
|
-
end
|
48
|
-
|
49
|
-
def get_reactions(channel_id:, message_id:, emoji:, params: {})
|
50
|
-
send_request(:get, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}", params:)
|
51
|
-
end
|
52
|
-
|
53
|
-
def delete_all_reactions(channel_id:, message_id:)
|
54
|
-
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions")
|
55
|
-
end
|
56
|
-
|
57
|
-
def delete_all_reactions_for_emoji(channel_id:, message_id:, emoji:)
|
58
|
-
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}")
|
59
|
-
end
|
60
|
-
|
61
|
-
def edit_message(channel_id:, message_id:, json:)
|
62
|
-
send_request(:patch, "/channels/#{channel_id}/messages/#{message_id}", json:)
|
63
|
-
end
|
64
|
-
|
65
|
-
def delete_message(channel_id:, message_id:)
|
66
|
-
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}")
|
67
|
-
end
|
68
|
-
|
69
|
-
def bulk_delete_messages(channel_id:, json:)
|
70
|
-
send_request(:post, "/channels/#{channel_id}/messages/bulk-delete", json:)
|
71
|
-
end
|
72
|
-
|
73
|
-
def edit_channel_permissions(channel_id:, overwrite_id:, json:)
|
74
|
-
send_request(:put, "/channels/#{channel_id}/permissions/#{overwrite_id}", json:)
|
75
|
-
end
|
76
|
-
|
77
|
-
def get_channel_invites(channel_id:)
|
78
|
-
send_request(:get, "/channels/#{channel_id}/invites")
|
79
|
-
end
|
80
|
-
|
81
|
-
def create_channel_invite(channel_id:, json:)
|
82
|
-
send_request(:post, "/channels/#{channel_id}/invites", json:)
|
83
|
-
end
|
84
|
-
|
85
|
-
def delete_channel_permission(channel_id:, overwrite_id:)
|
86
|
-
send_request(:delete, "/channels/#{channel_id}/permissions/#{overwrite_id}")
|
87
|
-
end
|
88
|
-
|
89
|
-
def follow_announcement_channel(channel_id:, json:)
|
90
|
-
send_request(:post, "/channels/#{channel_id}/followers", json:)
|
91
|
-
end
|
92
|
-
|
93
|
-
def trigger_typing_indicator(channel_id:)
|
94
|
-
send_request(:post, "/channels/#{channel_id}/typing")
|
95
|
-
end
|
96
|
-
|
97
|
-
def get_pinned_messages(channel_id:)
|
98
|
-
send_request(:get, "/channels/#{channel_id}/pins")
|
99
|
-
end
|
100
|
-
|
101
|
-
def pin_message(channel_id:, message_id:)
|
102
|
-
send_request(:put, "/channels/#{channel_id}/pins/#{message_id}")
|
103
|
-
end
|
104
|
-
|
105
|
-
def unpin_message(channel_id:, message_id:)
|
106
|
-
send_request(:delete, "/channels/#{channel_id}/pins/#{message_id}")
|
107
|
-
end
|
108
|
-
|
109
|
-
def group_dm_add_recipient(channel_id:, user_id:, json:)
|
110
|
-
send_request(:put, "/channels/#{channel_id}/recipients/#{user_id}", json:)
|
111
|
-
end
|
112
|
-
|
113
|
-
def group_dm_remove_recipient(channel_id:, user_id:)
|
114
|
-
send_request(:delete, "/channels/#{channel_id}/recipients/#{user_id}")
|
115
|
-
end
|
116
|
-
|
117
|
-
def start_thread_from_message(channel_id:, message_id:, json:)
|
118
|
-
send_request(:post, "/channels/#{channel_id}/messages/#{message_id}/threads", json:)
|
119
|
-
end
|
120
|
-
|
121
|
-
def start_thread_without_message(channel_id:, json:)
|
122
|
-
send_request(:post, "/channels/#{channel_id}/threads", json:)
|
123
|
-
end
|
124
|
-
|
125
|
-
# NOTE: this is clearly identical to `start_thread_without_message`, but i
|
126
|
-
# guess Discord treats the action differently based on what's in the JSON
|
127
|
-
# payload?
|
128
|
-
def start_thread_in_forum_or_media_channel(channel_id:, json:)
|
129
|
-
send_request(:post, "/channels/#{channel_id}/threads", json:)
|
130
|
-
end
|
131
|
-
|
132
|
-
def join_thread(channel_id:)
|
133
|
-
send_request(:put, "/channels/#{channel_id}/thread-members/@me")
|
134
|
-
end
|
135
|
-
|
136
|
-
def add_thread_member(channel_id:, user_id:)
|
137
|
-
send_request(:put, "/channels/#{channel_id}/thread-members/#{user_id}")
|
138
|
-
end
|
139
|
-
|
140
|
-
def leave_thread(channel_id:)
|
141
|
-
send_request(:delete, "/channels/#{channel_id}/thread-members/@me")
|
142
|
-
end
|
143
|
-
|
144
|
-
def remove_thread_member(channel_id:, user_id:)
|
145
|
-
send_request(:delete, "/channels/#{channel_id}/thread-members/#{user_id}")
|
146
|
-
end
|
147
|
-
|
148
|
-
def get_thread_member(channel_id:, user_id:, params: {})
|
149
|
-
send_request(:get, "/channels/#{channel_id}/thread-members/#{user_id}", params:)
|
150
|
-
end
|
151
|
-
|
152
|
-
def list_thread_members(channel_id:, params: {})
|
153
|
-
send_request(:get, "/channels/#{channel_id}/thread-members", params:)
|
154
|
-
end
|
155
|
-
|
156
|
-
def list_public_archived_threads(channel_id:, params: {})
|
157
|
-
send_request(:get, "/channels/#{channel_id}/threads/archived/public", params:)
|
158
|
-
end
|
159
|
-
|
160
|
-
def list_private_archived_threads(channel_id:, params: {})
|
161
|
-
send_request(:get, "/channels/#{channel_id}/threads/archived/private", params:)
|
162
|
-
end
|
163
|
-
|
164
|
-
def list_joined_private_archived_threads(channel_id:, params: {})
|
165
|
-
send_request(:get, "/channels/#{channel_id}/users/@me/threads/archived/private", params:)
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class Emoji < Resource
|
7
|
-
def list_guild_emojis(guild_id:)
|
8
|
-
send_request(:get, "/guilds/#{guild_id}/emojis")
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_guild_emoji(guild_id:, emoji_id:)
|
12
|
-
send_request(:get, "/guilds/#{guild_id}/emojis/#{emoji_id}")
|
13
|
-
end
|
14
|
-
|
15
|
-
def create_guild_emoji(guild_id:, json:)
|
16
|
-
send_request(:post, "/guilds/#{guild_id}/emojis", json:)
|
17
|
-
end
|
18
|
-
|
19
|
-
def modify_guild_emoji(guild_id:, emoji_id:, json:)
|
20
|
-
send_request(:patch, "/guilds/#{guild_id}/emojis/#{emoji_id}", json:)
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete_guild_emoji(guild_id:, emoji_id:)
|
24
|
-
send_request(:delete, "/guilds/#{guild_id}/emojis/#{emoji_id}")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,196 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class Guild < Resource
|
7
|
-
def create_guild(json:)
|
8
|
-
send_request(:post, "/guilds", json:)
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_guild(guild_id:, params: {})
|
12
|
-
send_request(:get, "/guilds/#{guild_id}", params:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_guild_preview(guild_id:)
|
16
|
-
send_request(:get, "/guilds/#{guild_id}/preview")
|
17
|
-
end
|
18
|
-
|
19
|
-
def modify_guild(guild_id:, json:)
|
20
|
-
send_request(:patch, "/guilds/#{guild_id}", json:)
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete_guild(guild_id:)
|
24
|
-
send_request(:delete, "/guilds/#{guild_id}")
|
25
|
-
end
|
26
|
-
|
27
|
-
def get_guild_channels(guild_id:)
|
28
|
-
send_request(:get, "/guilds/#{guild_id}/channels")
|
29
|
-
end
|
30
|
-
|
31
|
-
def create_guild_channel(guild_id:, json:)
|
32
|
-
send_request(:post, "/guilds/#{guild_id}/channels", json:)
|
33
|
-
end
|
34
|
-
|
35
|
-
def modify_guild_channel_positions(guild_id:, json:)
|
36
|
-
send_request(:patch, "/guilds/#{guild_id}/channels", json:)
|
37
|
-
end
|
38
|
-
|
39
|
-
def list_active_guild_threads(guild_id:)
|
40
|
-
send_request(:get, "/guilds/#{guild_id}/threads/active")
|
41
|
-
end
|
42
|
-
|
43
|
-
def get_guild_member(guild_id:, user_id:)
|
44
|
-
send_request(:get, "/guilds/#{guild_id}/members/#{user_id}")
|
45
|
-
end
|
46
|
-
|
47
|
-
def list_guild_members(guild_id:, params: {})
|
48
|
-
send_request(:get, "/guilds/#{guild_id}/members", params:)
|
49
|
-
end
|
50
|
-
|
51
|
-
def search_guild_members(guild_id:, params: {})
|
52
|
-
send_request(:get, "/guilds/#{guild_id}/members/search", params:)
|
53
|
-
end
|
54
|
-
|
55
|
-
def add_guild_member(guild_id:, user_id:, json:)
|
56
|
-
send_request(:put, "/guilds/#{guild_id}/members/#{user_id}", json:)
|
57
|
-
end
|
58
|
-
|
59
|
-
def modify_guild_member(guild_id:, user_id:, json:)
|
60
|
-
send_request(:patch, "/guilds/#{guild_id}/members/#{user_id}", json:)
|
61
|
-
end
|
62
|
-
|
63
|
-
def modify_current_member(guild_id:, json:)
|
64
|
-
send_request(:patch, "/guilds/#{guild_id}/members/@me", json:)
|
65
|
-
end
|
66
|
-
|
67
|
-
# NOTE: deprecated in favor of `modify_current_member`
|
68
|
-
def modify_current_user_nick(guild_id:, json:)
|
69
|
-
send_request(:patch, "/guilds/#{guild_id}/members/@me/nick", json:)
|
70
|
-
end
|
71
|
-
|
72
|
-
def add_guild_member_role(guild_id:, user_id:, role_id:)
|
73
|
-
send_request(:put, "/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}")
|
74
|
-
end
|
75
|
-
|
76
|
-
def remove_guild_member_role(guild_id:, user_id:, role_id:)
|
77
|
-
send_request(:delete, "/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}")
|
78
|
-
end
|
79
|
-
|
80
|
-
def remove_guild_member(guild_id:, user_id:)
|
81
|
-
send_request(:delete, "/guilds/#{guild_id}/members/#{user_id}")
|
82
|
-
end
|
83
|
-
|
84
|
-
def get_guild_bans(guild_id:, params: {})
|
85
|
-
send_request(:get, "/guilds/#{guild_id}/bans", params:)
|
86
|
-
end
|
87
|
-
|
88
|
-
def get_guild_ban(guild_id:, user_id:)
|
89
|
-
send_request(:get, "/guilds/#{guild_id}/bans/#{user_id}")
|
90
|
-
end
|
91
|
-
|
92
|
-
def create_guild_ban(guild_id:, user_id:, json:)
|
93
|
-
send_request(:put, "/guilds/#{guild_id}/bans/#{user_id}", json:)
|
94
|
-
end
|
95
|
-
|
96
|
-
def remove_guild_ban(guild_id:, user_id:)
|
97
|
-
send_request(:delete, "/guilds/#{guild_id}/bans/#{user_id}")
|
98
|
-
end
|
99
|
-
|
100
|
-
def bulk_guild_ban(guild_id:, json:)
|
101
|
-
send_request(:post, "/guilds/#{guild_id}/bulk-ban", json:)
|
102
|
-
end
|
103
|
-
|
104
|
-
def get_guild_roles(guild_id:)
|
105
|
-
send_request(:get, "/guilds/#{guild_id}/roles")
|
106
|
-
end
|
107
|
-
|
108
|
-
def create_guild_role(guild_id:, json:)
|
109
|
-
send_request(:post, "/guilds/#{guild_id}/roles", json:)
|
110
|
-
end
|
111
|
-
|
112
|
-
def modify_guild_role_positions(guild_id:, json:)
|
113
|
-
send_request(:patch, "/guilds/#{guild_id}/roles", json:)
|
114
|
-
end
|
115
|
-
|
116
|
-
def modify_guild_role(guild_id:, role_id:, json:)
|
117
|
-
send_request(:patch, "/guilds/#{guild_id}/roles/#{role_id}", json:)
|
118
|
-
end
|
119
|
-
|
120
|
-
def modify_guild_mfa_level(guild_id:, json:)
|
121
|
-
send_request(:post, "/guilds/#{guild_id}/mfa", json:)
|
122
|
-
end
|
123
|
-
|
124
|
-
def delete_guild_role(guild_id:, role_id:)
|
125
|
-
send_request(:delete, "/guilds/#{guild_id}/roles/#{role_id}")
|
126
|
-
end
|
127
|
-
|
128
|
-
def get_guild_prune_count(guild_id:, params: {})
|
129
|
-
send_request(:get, "/guilds/#{guild_id}/prune", params:)
|
130
|
-
end
|
131
|
-
|
132
|
-
def begin_guild_prune(guild_id:, json:)
|
133
|
-
send_request(:post, "/guilds/#{guild_id}/prune", json:)
|
134
|
-
end
|
135
|
-
|
136
|
-
def get_guild_voice_regions(guild_id:)
|
137
|
-
send_request(:get, "/guilds/#{guild_id}/regions")
|
138
|
-
end
|
139
|
-
|
140
|
-
def get_guild_invites(guild_id:)
|
141
|
-
send_request(:get, "/guilds/#{guild_id}/invites")
|
142
|
-
end
|
143
|
-
|
144
|
-
def get_guild_integrations(guild_id:)
|
145
|
-
send_request(:get, "/guilds/#{guild_id}/integrations")
|
146
|
-
end
|
147
|
-
|
148
|
-
def delete_guild_integration(guild_id:, integration_id:)
|
149
|
-
send_request(:delete, "/guilds/#{guild_id}/integrations/#{integration_id}")
|
150
|
-
end
|
151
|
-
|
152
|
-
def get_guild_widget_settings(guild_id:)
|
153
|
-
send_request(:get, "/guilds/#{guild_id}/widget")
|
154
|
-
end
|
155
|
-
|
156
|
-
def modify_guild_widget(guild_id:, json:)
|
157
|
-
send_request(:patch, "/guilds/#{guild_id}/widget", json:)
|
158
|
-
end
|
159
|
-
|
160
|
-
def get_guild_widget(guild_id:)
|
161
|
-
send_request(:get, "/guilds/#{guild_id}/widget.json")
|
162
|
-
end
|
163
|
-
|
164
|
-
def get_guild_vanity_url(guild_id:)
|
165
|
-
send_request(:get, "/guilds/#{guild_id}/vanity-url")
|
166
|
-
end
|
167
|
-
|
168
|
-
def get_guild_widget_image(guild_id:, params: {})
|
169
|
-
send_request(:get, "/guilds/#{guild_id}/widget.png", params:)
|
170
|
-
end
|
171
|
-
|
172
|
-
def get_guild_welcome_screen(guild_id:)
|
173
|
-
send_request(:get, "/guilds/#{guild_id}/welcome-screen")
|
174
|
-
end
|
175
|
-
|
176
|
-
def modify_guild_welcome_screen(guild_id:, json:)
|
177
|
-
send_request(:patch, "/guilds/#{guild_id}/welcome-screen", json:)
|
178
|
-
end
|
179
|
-
|
180
|
-
def get_guild_onboarding(guild_id:)
|
181
|
-
send_request(:get, "/guilds/#{guild_id}/onboarding")
|
182
|
-
end
|
183
|
-
|
184
|
-
def modify_guild_onboarding(guild_id:, json:)
|
185
|
-
send_request(:put, "/guilds/#{guild_id}/onboarding", json:)
|
186
|
-
end
|
187
|
-
|
188
|
-
def modify_current_user_voice_state(guild_id:, json:)
|
189
|
-
send_request(:patch, "/guilds/#{guild_id}/voice-states/@me", json:)
|
190
|
-
end
|
191
|
-
|
192
|
-
def modify_user_voice_state(guild_id:, user_id:, json:)
|
193
|
-
send_request(:patch, "/guilds/#{guild_id}/voice-states/#{user_id}", json:)
|
194
|
-
end
|
195
|
-
end
|
196
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class GuildScheduledEvent < Resource
|
7
|
-
def list_scheduled_events_for_guild(guild_id:, params: {})
|
8
|
-
send_request(:get, "/guilds/#{guild_id}/scheduled-events", params:)
|
9
|
-
end
|
10
|
-
|
11
|
-
def create_guild_scheduled_event(guild_id:, json:)
|
12
|
-
send_request(:post, "/guilds/#{guild_id}/scheduled-events", json:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_guild_scheduled_event(guild_id:, guild_scheduled_event_id:, params: {})
|
16
|
-
send_request(:get, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}", params:)
|
17
|
-
end
|
18
|
-
|
19
|
-
def modify_guild_scheduled_event(guild_id:, guild_scheduled_event_id:, json:)
|
20
|
-
send_request(:patch, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}", json:)
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete_guild_scheduled_event(guild_id:, guild_scheduled_event_id:)
|
24
|
-
send_request(:delete, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}")
|
25
|
-
end
|
26
|
-
|
27
|
-
def get_guild_scheduled_event_users(guild_id:, guild_scheduled_event_id:, params: {})
|
28
|
-
send_request(:get, "/guilds/#{guild_id}/scheduled-events/#{guild_scheduled_event_id}/users", params:)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class GuildTemplate < Resource
|
7
|
-
def get_guild_template(template_code:)
|
8
|
-
send_request(:get, "/guilds/templates/#{template_code}")
|
9
|
-
end
|
10
|
-
|
11
|
-
def create_guild_from_template(template_code:, json:)
|
12
|
-
send_request(:post, "/guilds/templates/#{template_code}", json:)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_guild_templates(guild_id:)
|
16
|
-
send_request(:get, "/guilds/#{guild_id}/templates")
|
17
|
-
end
|
18
|
-
|
19
|
-
def create_guild_template(guild_id:, json:)
|
20
|
-
send_request(:post, "/guilds/#{guild_id}/templates", json:)
|
21
|
-
end
|
22
|
-
|
23
|
-
def sync_guild_template(guild_id:, template_code:)
|
24
|
-
send_request(:put, "/guilds/#{guild_id}/templates/#{template_code}")
|
25
|
-
end
|
26
|
-
|
27
|
-
def modify_guild_template(guild_id:, template_code:, json:)
|
28
|
-
send_request(:patch, "/guilds/#{guild_id}/templates/#{template_code}", json:)
|
29
|
-
end
|
30
|
-
|
31
|
-
def delete_guild_template(guild_id:, template_code:)
|
32
|
-
send_request(:delete, "/guilds/#{guild_id}/templates/#{template_code}")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class Interaction < Resource
|
7
|
-
def create_interaction_response(interaction_id:, interaction_token:, json:)
|
8
|
-
send_request(:post, "/interactions/#{interaction_id}/#{interaction_token}/callback", json:)
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_original_interaction_response(application_id:, interaction_token:)
|
12
|
-
send_request(:get, "/webhooks/#{application_id}/#{interaction_token}/messages/@original")
|
13
|
-
end
|
14
|
-
|
15
|
-
def edit_original_interaction_response(application_id:, interaction_token:, json:)
|
16
|
-
send_request(:patch, "/webhooks/#{application_id}/#{interaction_token}/messages/@original", json:)
|
17
|
-
end
|
18
|
-
|
19
|
-
def delete_original_interaction_response(application_id:, interaction_token:)
|
20
|
-
send_request(:delete, "/webhooks/#{application_id}/#{interaction_token}/messages/@original")
|
21
|
-
end
|
22
|
-
|
23
|
-
def create_followup_message(application_id:, interaction_token:, json:)
|
24
|
-
send_request(:post, "/webhooks/#{application_id}/#{interaction_token}", json:)
|
25
|
-
end
|
26
|
-
|
27
|
-
def get_followup_message(application_id:, interaction_token:, message_id:)
|
28
|
-
send_request(:get, "/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}")
|
29
|
-
end
|
30
|
-
|
31
|
-
def edit_followup_message(application_id:, interaction_token:, message_id:, json:)
|
32
|
-
send_request(:patch, "/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}", json:)
|
33
|
-
end
|
34
|
-
|
35
|
-
def delete_followup_message(application_id:, interaction_token:, message_id:)
|
36
|
-
send_request(:delete, "/webhooks/#{application_id}/#{interaction_token}/messages/#{message_id}")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class Invite < Resource
|
7
|
-
def get_invite(invite_code:, params: {})
|
8
|
-
send_request(:get, "/invites/#{invite_code}", params:)
|
9
|
-
end
|
10
|
-
|
11
|
-
def delete_invite(invite_code:)
|
12
|
-
send_request(:delete, "/invites/#{invite_code}")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lib_discord/resource"
|
4
|
-
|
5
|
-
module LibDiscord
|
6
|
-
class StageInstance < Resource
|
7
|
-
def create_stage_instance(json:)
|
8
|
-
send_request(:post, "/stage-instances", json:)
|
9
|
-
end
|
10
|
-
|
11
|
-
def get_stage_instance(channel_id:)
|
12
|
-
send_request(:get, "/stage-instances/#{channel_id}")
|
13
|
-
end
|
14
|
-
|
15
|
-
def modify_stage_instance(channel_id:, json:)
|
16
|
-
send_request(:patch, "/stage-instances/#{channel_id}", json:)
|
17
|
-
end
|
18
|
-
|
19
|
-
def delete_stage_instance(channel_id:)
|
20
|
-
send_request(:delete, "/stage-instances/#{channel_id}")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|