Class: LibDiscord::Guild
Overview
Guild Resource
Do not instantiate a Guild directly. Instead request one from an instance of Client.
client = LibDiscord::Client.new("Bot auth.token")
g = client["guild"]
Instance Method Summary
collapse
-
#add_guild_member(guild_id:, user_id:, json:) ⇒ Response
-
#add_guild_member_role(guild_id:, user_id:, role_id:) ⇒ Response
-
#begin_guild_prune(guild_id:, json:) ⇒ Response
-
#bulk_guild_ban(guild_id:, json:) ⇒ Response
-
#create_guild(json:) ⇒ Response
-
#create_guild_ban(guild_id:, user_id:, json:) ⇒ Response
-
#create_guild_channel(guild_id:, json:) ⇒ Response
-
#create_guild_role(guild_id:, json:) ⇒ Response
-
#delete_guild(guild_id:) ⇒ Response
-
#delete_guild_integration(guild_id:, integration_id:) ⇒ Response
-
#delete_guild_role(guild_id:, role_id:) ⇒ Response
-
#get_guild(guild_id:, params: {}) ⇒ Response
-
#get_guild_ban(guild_id:, user_id:) ⇒ Response
-
#get_guild_bans(guild_id:, params: {}) ⇒ Response
-
#get_guild_channels(guild_id:) ⇒ Response
-
#get_guild_integrations(guild_id:) ⇒ Response
-
#get_guild_invites(guild_id:) ⇒ Response
-
#get_guild_member(guild_id:, user_id:) ⇒ Response
-
#get_guild_onboarding(guild_id:) ⇒ Response
-
#get_guild_preview(guild_id:) ⇒ Response
-
#get_guild_prune_count(guild_id:, params: {}) ⇒ Response
-
#get_guild_roles(guild_id:) ⇒ Response
-
#get_guild_vanity_url(guild_id:) ⇒ Response
-
#get_guild_voice_regions(guild_id:) ⇒ Response
-
#get_guild_welcome_screen(guild_id:) ⇒ Response
-
#get_guild_widget(guild_id:) ⇒ Response
-
#get_guild_widget_image(guild_id:, params: {}) ⇒ Response
-
#get_guild_widget_settings(guild_id:) ⇒ Response
-
#list_active_guild_threads(guild_id:) ⇒ Response
-
#list_guild_members(guild_id:, params: {}) ⇒ Response
-
#modify_current_member(guild_id:, json:) ⇒ Response
-
#modify_current_user_nick(guild_id:, json:) ⇒ Response
deprecated
Deprecated.
-
#modify_current_user_voice_state(guild_id:, json:) ⇒ Response
-
#modify_guild(guild_id:, json:) ⇒ Response
-
#modify_guild_channel_positions(guild_id:, json:) ⇒ Response
-
#modify_guild_member(guild_id:, user_id:, json:) ⇒ Response
-
#modify_guild_mfa_level(guild_id:, json:) ⇒ Response
-
#modify_guild_onboarding(guild_id:, json:) ⇒ Response
-
#modify_guild_role(guild_id:, role_id:, json:) ⇒ Response
-
#modify_guild_role_positions(guild_id:, json:) ⇒ Response
-
#modify_guild_welcome_screen(guild_id:, json:) ⇒ Response
-
#modify_guild_widget(guild_id:, json:) ⇒ Response
-
#modify_user_voice_state(guild_id:, user_id:, json:) ⇒ Response
-
#remove_guild_ban(guild_id:, user_id:) ⇒ Response
-
#remove_guild_member(guild_id:, user_id:) ⇒ Response
-
#remove_guild_member_role(guild_id:, user_id:, role_id:) ⇒ Response
-
#search_guild_members(guild_id:, params: {}) ⇒ Response
Methods inherited from Resource
#initialize
Instance Method Details
#add_guild_member(guild_id:, user_id:, json:) ⇒ Response
231
232
233
|
# File 'lib/lib_discord/guild.rb', line 231
def add_guild_member(guild_id:, user_id:, json:)
send_request(:put, "/guilds/#{guild_id}/members/#{user_id}", json:)
end
|
#add_guild_member_role(guild_id:, user_id:, role_id:) ⇒ Response
308
309
310
|
# File 'lib/lib_discord/guild.rb', line 308
def add_guild_member_role(guild_id:, user_id:, role_id:)
send_request(:put, "/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}")
end
|
#begin_guild_prune(guild_id:, json:) ⇒ Response
577
578
579
|
# File 'lib/lib_discord/guild.rb', line 577
def begin_guild_prune(guild_id:, json:)
send_request(:post, "/guilds/#{guild_id}/prune", json:)
end
|
#bulk_guild_ban(guild_id:, json:) ⇒ Response
438
439
440
|
# File 'lib/lib_discord/guild.rb', line 438
def bulk_guild_ban(guild_id:, json:)
send_request(:post, "/guilds/#{guild_id}/bulk-ban", json:)
end
|
#create_guild(json:) ⇒ Response
28
29
30
|
# File 'lib/lib_discord/guild.rb', line 28
def create_guild(json:)
send_request(:post, "/guilds", json:)
end
|
#create_guild_ban(guild_id:, user_id:, json:) ⇒ Response
403
404
405
|
# File 'lib/lib_discord/guild.rb', line 403
def create_guild_ban(guild_id:, user_id:, json:)
send_request(:put, "/guilds/#{guild_id}/bans/#{user_id}", json:)
end
|
#create_guild_channel(guild_id:, json:) ⇒ Response
125
126
127
|
# File 'lib/lib_discord/guild.rb', line 125
def create_guild_channel(guild_id:, json:)
send_request(:post, "/guilds/#{guild_id}/channels", json:)
end
|
#create_guild_role(guild_id:, json:) ⇒ Response
470
471
472
|
# File 'lib/lib_discord/guild.rb', line 470
def create_guild_role(guild_id:, json:)
send_request(:post, "/guilds/#{guild_id}/roles", json:)
end
|
#delete_guild(guild_id:) ⇒ Response
93
94
95
|
# File 'lib/lib_discord/guild.rb', line 93
def delete_guild(guild_id:)
send_request(:delete, "/guilds/#{guild_id}")
end
|
#delete_guild_integration(guild_id:, integration_id:) ⇒ Response
640
641
642
|
# File 'lib/lib_discord/guild.rb', line 640
def delete_guild_integration(guild_id:, integration_id:)
send_request(:delete, "/guilds/#{guild_id}/integrations/#{integration_id}")
end
|
#delete_guild_role(guild_id:, role_id:) ⇒ Response
542
543
544
|
# File 'lib/lib_discord/guild.rb', line 542
def delete_guild_role(guild_id:, role_id:)
send_request(:delete, "/guilds/#{guild_id}/roles/#{role_id}")
end
|
#get_guild(guild_id:, params: {}) ⇒ Response
46
47
48
|
# File 'lib/lib_discord/guild.rb', line 46
def get_guild(guild_id:, params: {})
send_request(:get, "/guilds/#{guild_id}", params:)
end
|
#get_guild_ban(guild_id:, user_id:) ⇒ Response
383
384
385
|
# File 'lib/lib_discord/guild.rb', line 383
def get_guild_ban(guild_id:, user_id:)
send_request(:get, "/guilds/#{guild_id}/bans/#{user_id}")
end
|
#get_guild_bans(guild_id:, params: {}) ⇒ Response
365
366
367
|
# File 'lib/lib_discord/guild.rb', line 365
def get_guild_bans(guild_id:, params: {})
send_request(:get, "/guilds/#{guild_id}/bans", params:)
end
|
#get_guild_channels(guild_id:) ⇒ Response
108
109
110
|
# File 'lib/lib_discord/guild.rb', line 108
def get_guild_channels(guild_id:)
send_request(:get, "/guilds/#{guild_id}/channels")
end
|
#get_guild_integrations(guild_id:) ⇒ Response
622
623
624
|
# File 'lib/lib_discord/guild.rb', line 622
def get_guild_integrations(guild_id:)
send_request(:get, "/guilds/#{guild_id}/integrations")
end
|
#get_guild_invites(guild_id:) ⇒ Response
607
608
609
|
# File 'lib/lib_discord/guild.rb', line 607
def get_guild_invites(guild_id:)
send_request(:get, "/guilds/#{guild_id}/invites")
end
|
#get_guild_member(guild_id:, user_id:) ⇒ Response
175
176
177
|
# File 'lib/lib_discord/guild.rb', line 175
def get_guild_member(guild_id:, user_id:)
send_request(:get, "/guilds/#{guild_id}/members/#{user_id}")
end
|
#get_guild_onboarding(guild_id:) ⇒ Response
772
773
774
|
# File 'lib/lib_discord/guild.rb', line 772
def get_guild_onboarding(guild_id:)
send_request(:get, "/guilds/#{guild_id}/onboarding")
end
|
#get_guild_preview(guild_id:) ⇒ Response
61
62
63
|
# File 'lib/lib_discord/guild.rb', line 61
def get_guild_preview(guild_id:)
send_request(:get, "/guilds/#{guild_id}/preview")
end
|
#get_guild_prune_count(guild_id:, params: {}) ⇒ Response
560
561
562
|
# File 'lib/lib_discord/guild.rb', line 560
def get_guild_prune_count(guild_id:, params: {})
send_request(:get, "/guilds/#{guild_id}/prune", params:)
end
|
#get_guild_roles(guild_id:) ⇒ Response
453
454
455
|
# File 'lib/lib_discord/guild.rb', line 453
def get_guild_roles(guild_id:)
send_request(:get, "/guilds/#{guild_id}/roles")
end
|
#get_guild_vanity_url(guild_id:) ⇒ Response
702
703
704
|
# File 'lib/lib_discord/guild.rb', line 702
def get_guild_vanity_url(guild_id:)
send_request(:get, "/guilds/#{guild_id}/vanity-url")
end
|
#get_guild_voice_regions(guild_id:) ⇒ Response
592
593
594
|
# File 'lib/lib_discord/guild.rb', line 592
def get_guild_voice_regions(guild_id:)
send_request(:get, "/guilds/#{guild_id}/regions")
end
|
#get_guild_welcome_screen(guild_id:) ⇒ Response
740
741
742
|
# File 'lib/lib_discord/guild.rb', line 740
def get_guild_welcome_screen(guild_id:)
send_request(:get, "/guilds/#{guild_id}/welcome-screen")
end
|
687
688
689
|
# File 'lib/lib_discord/guild.rb', line 687
def get_guild_widget(guild_id:)
send_request(:get, "/guilds/#{guild_id}/widget.json")
end
|
720
721
722
723
724
725
726
727
|
# File 'lib/lib_discord/guild.rb', line 720
def get_guild_widget_image(guild_id:, params: {})
send_request(
:get,
"/guilds/#{guild_id}/widget.png",
http_client: client,
params:
)
end
|
655
656
657
|
# File 'lib/lib_discord/guild.rb', line 655
def get_guild_widget_settings(guild_id:)
send_request(:get, "/guilds/#{guild_id}/widget")
end
|
#list_active_guild_threads(guild_id:) ⇒ Response
157
158
159
|
# File 'lib/lib_discord/guild.rb', line 157
def list_active_guild_threads(guild_id:)
send_request(:get, "/guilds/#{guild_id}/threads/active")
end
|
#list_guild_members(guild_id:, params: {}) ⇒ Response
193
194
195
|
# File 'lib/lib_discord/guild.rb', line 193
def list_guild_members(guild_id:, params: {})
send_request(:get, "/guilds/#{guild_id}/members", params:)
end
|
#modify_current_member(guild_id:, json:) ⇒ Response
268
269
270
|
# File 'lib/lib_discord/guild.rb', line 268
def modify_current_member(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/members/@me", json:)
end
|
#modify_current_user_nick(guild_id:, json:) ⇒ Response
287
288
289
|
# File 'lib/lib_discord/guild.rb', line 287
def modify_current_user_nick(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/members/@me/nick", json:)
end
|
#modify_current_user_voice_state(guild_id:, json:) ⇒ Response
806
807
808
|
# File 'lib/lib_discord/guild.rb', line 806
def modify_current_user_voice_state(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/voice-states/@me", json:)
end
|
#modify_guild(guild_id:, json:) ⇒ Response
78
79
80
|
# File 'lib/lib_discord/guild.rb', line 78
def modify_guild(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}", json:)
end
|
#modify_guild_channel_positions(guild_id:, json:) ⇒ Response
142
143
144
|
# File 'lib/lib_discord/guild.rb', line 142
def modify_guild_channel_positions(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/channels", json:)
end
|
#modify_guild_member(guild_id:, user_id:, json:) ⇒ Response
251
252
253
|
# File 'lib/lib_discord/guild.rb', line 251
def modify_guild_member(guild_id:, user_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/members/#{user_id}", json:)
end
|
#modify_guild_mfa_level(guild_id:, json:) ⇒ Response
524
525
526
|
# File 'lib/lib_discord/guild.rb', line 524
def modify_guild_mfa_level(guild_id:, json:)
send_request(:post, "/guilds/#{guild_id}/mfa", json:)
end
|
#modify_guild_onboarding(guild_id:, json:) ⇒ Response
789
790
791
|
# File 'lib/lib_discord/guild.rb', line 789
def modify_guild_onboarding(guild_id:, json:)
send_request(:put, "/guilds/#{guild_id}/onboarding", json:)
end
|
#modify_guild_role(guild_id:, role_id:, json:) ⇒ Response
507
508
509
|
# File 'lib/lib_discord/guild.rb', line 507
def modify_guild_role(guild_id:, role_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/roles/#{role_id}", json:)
end
|
#modify_guild_role_positions(guild_id:, json:) ⇒ Response
487
488
489
|
# File 'lib/lib_discord/guild.rb', line 487
def modify_guild_role_positions(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/roles", json:)
end
|
#modify_guild_welcome_screen(guild_id:, json:) ⇒ Response
757
758
759
|
# File 'lib/lib_discord/guild.rb', line 757
def modify_guild_welcome_screen(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/welcome-screen", json:)
end
|
672
673
674
|
# File 'lib/lib_discord/guild.rb', line 672
def modify_guild_widget(guild_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/widget", json:)
end
|
#modify_user_voice_state(guild_id:, user_id:, json:) ⇒ Response
826
827
828
|
# File 'lib/lib_discord/guild.rb', line 826
def modify_user_voice_state(guild_id:, user_id:, json:)
send_request(:patch, "/guilds/#{guild_id}/voice-states/#{user_id}", json:)
end
|
#remove_guild_ban(guild_id:, user_id:) ⇒ Response
421
422
423
|
# File 'lib/lib_discord/guild.rb', line 421
def remove_guild_ban(guild_id:, user_id:)
send_request(:delete, "/guilds/#{guild_id}/bans/#{user_id}")
end
|
#remove_guild_member(guild_id:, user_id:) ⇒ Response
347
348
349
|
# File 'lib/lib_discord/guild.rb', line 347
def remove_guild_member(guild_id:, user_id:)
send_request(:delete, "/guilds/#{guild_id}/members/#{user_id}")
end
|
#remove_guild_member_role(guild_id:, user_id:, role_id:) ⇒ Response
329
330
331
|
# File 'lib/lib_discord/guild.rb', line 329
def remove_guild_member_role(guild_id:, user_id:, role_id:)
send_request(:delete, "/guilds/#{guild_id}/members/#{user_id}/roles/#{role_id}")
end
|
#search_guild_members(guild_id:, params: {}) ⇒ Response
211
212
213
|
# File 'lib/lib_discord/guild.rb', line 211
def search_guild_members(guild_id:, params: {})
send_request(:get, "/guilds/#{guild_id}/members/search", params:)
end
|