Class: LibDiscord::Channel
Overview
Channels Resource
Do not instantiate a Channel directly. Instead request one from an instance of Client.
client = LibDiscord::Client.new("Bot auth.token")
c = client["channel"]
Instance Method Summary
collapse
-
#add_thread_member(channel_id:, user_id:) ⇒ Response
-
#bulk_delete_messages(channel_id:, json:) ⇒ Response
-
#create_channel_invite(channel_id:, json:) ⇒ Response
-
#create_message(channel_id:, json:) ⇒ Response
-
#create_reaction(channel_id:, message_id:, emoji:) ⇒ Response
-
#crosspost_message(channel_id:, message_id:) ⇒ Response
-
#delete_all_reactions(channel_id:, message_id:) ⇒ Response
-
#delete_all_reactions_for_emoji(channel_id:, message_id:, emoji:) ⇒ Response
-
#delete_channel(channel_id:) ⇒ Response
(also: #close_channel)
-
#delete_channel_permission(channel_id:, overwrite_id:) ⇒ Response
-
#delete_message(channel_id:, message_id:) ⇒ Response
-
#delete_own_reaction(channel_id:, message_id:, emoji:) ⇒ Response
-
#delete_user_reaction(channel_id:, message_id:, emoji:, user_id:) ⇒ Response
-
#edit_channel_permissions(channel_id:, overwrite_id:, json:) ⇒ Response
-
#edit_message(channel_id:, message_id:, json:) ⇒ Response
-
#follow_announcement_channel(channel_id:, json:) ⇒ Response
-
#get_channel(channel_id:) ⇒ Response
-
#get_channel_invites(channel_id:) ⇒ Response
-
#get_channel_message(channel_id:, message_id:) ⇒ Response
-
#get_channel_messages(channel_id:, params: {}) ⇒ Response
-
#get_pinned_messages(channel_id:) ⇒ Response
-
#get_reactions(channel_id:, message_id:, emoji:, params: {}) ⇒ Response
-
#get_thread_member(channel_id:, user_id:, params: {}) ⇒ Response
-
#group_dm_add_recipient(channel_id:, user_id:, json:) ⇒ Response
-
#group_dm_remove_recipient(channel_id:, user_id:) ⇒ Response
-
#join_thread(channel_id:) ⇒ Response
-
#leave_thread(channel_id:) ⇒ Response
-
#list_joined_private_archived_threads(channel_id:, params: {}) ⇒ Response
-
#list_private_archived_threads(channel_id:, params: {}) ⇒ Response
-
#list_public_archived_threads(channel_id:, params: {}) ⇒ Response
-
#list_thread_members(channel_id:, params: {}) ⇒ Response
-
#modify_channel(channel_id:, json:) ⇒ Response
-
#pin_message(channel_id:, message_id:) ⇒ Response
-
#remove_thread_member(channel_id:, user_id:) ⇒ Response
-
#start_thread_from_message(channel_id:, message_id:, json:) ⇒ Response
-
#start_thread_in_forum_or_media_channel(channel_id:, json:) ⇒ Response
-
#start_thread_without_message(channel_id:, json:) ⇒ Response
-
#trigger_typing_indicator(channel_id:) ⇒ Response
-
#unpin_message(channel_id:, message_id:) ⇒ Response
Methods inherited from Resource
#initialize
Instance Method Details
#add_thread_member(channel_id:, user_id:) ⇒ Response
586
587
588
|
# File 'lib/lib_discord/channel.rb', line 586
def add_thread_member(channel_id:, user_id:)
send_request(:put, "/channels/#{channel_id}/thread-members/#{user_id}")
end
|
#bulk_delete_messages(channel_id:, json:) ⇒ Response
308
309
310
|
# File 'lib/lib_discord/channel.rb', line 308
def bulk_delete_messages(channel_id:, json:)
send_request(:post, "/channels/#{channel_id}/messages/bulk-delete", json:)
end
|
#create_channel_invite(channel_id:, json:) ⇒ Response
360
361
362
|
# File 'lib/lib_discord/channel.rb', line 360
def create_channel_invite(channel_id:, json:)
send_request(:post, "/channels/#{channel_id}/invites", json:)
end
|
#create_message(channel_id:, json:) ⇒ Response
116
117
118
|
# File 'lib/lib_discord/channel.rb', line 116
def create_message(channel_id:, json:)
send_request(:post, "/channels/#{channel_id}/messages", json:)
end
|
#create_reaction(channel_id:, message_id:, emoji:) ⇒ Response
153
154
155
|
# File 'lib/lib_discord/channel.rb', line 153
def create_reaction(channel_id:, message_id:, emoji:)
send_request(:put, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me")
end
|
#crosspost_message(channel_id:, message_id:) ⇒ Response
134
135
136
|
# File 'lib/lib_discord/channel.rb', line 134
def crosspost_message(channel_id:, message_id:)
send_request(:post, "/channels/#{channel_id}/messages/#{message_id}/crosspost")
end
|
#delete_all_reactions(channel_id:, message_id:) ⇒ Response
234
235
236
|
# File 'lib/lib_discord/channel.rb', line 234
def delete_all_reactions(channel_id:, message_id:)
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions")
end
|
#delete_all_reactions_for_emoji(channel_id:, message_id:, emoji:) ⇒ Response
253
254
255
|
# File 'lib/lib_discord/channel.rb', line 253
def delete_all_reactions_for_emoji(channel_id:, message_id:, emoji:)
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}")
end
|
#delete_channel(channel_id:) ⇒ Response
Also known as:
close_channel
61
62
63
|
# File 'lib/lib_discord/channel.rb', line 61
def delete_channel(channel_id:)
send_request(:delete, "/channels/#{channel_id}")
end
|
#delete_channel_permission(channel_id:, overwrite_id:) ⇒ Response
378
379
380
|
# File 'lib/lib_discord/channel.rb', line 378
def delete_channel_permission(channel_id:, overwrite_id:)
send_request(:delete, "/channels/#{channel_id}/permissions/#{overwrite_id}")
end
|
#delete_message(channel_id:, message_id:) ⇒ Response
291
292
293
|
# File 'lib/lib_discord/channel.rb', line 291
def delete_message(channel_id:, message_id:)
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}")
end
|
#delete_own_reaction(channel_id:, message_id:, emoji:) ⇒ Response
172
173
174
|
# File 'lib/lib_discord/channel.rb', line 172
def delete_own_reaction(channel_id:, message_id:, emoji:)
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/@me")
end
|
#delete_user_reaction(channel_id:, message_id:, emoji:, user_id:) ⇒ Response
194
195
196
|
# File 'lib/lib_discord/channel.rb', line 194
def delete_user_reaction(channel_id:, message_id:, emoji:, user_id:)
send_request(:delete, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}/#{user_id}")
end
|
#edit_channel_permissions(channel_id:, overwrite_id:, json:) ⇒ Response
328
329
330
|
# File 'lib/lib_discord/channel.rb', line 328
def edit_channel_permissions(channel_id:, overwrite_id:, json:)
send_request(:put, "/channels/#{channel_id}/permissions/#{overwrite_id}", json:)
end
|
#edit_message(channel_id:, message_id:, json:) ⇒ Response
273
274
275
|
# File 'lib/lib_discord/channel.rb', line 273
def edit_message(channel_id:, message_id:, json:)
send_request(:patch, "/channels/#{channel_id}/messages/#{message_id}", json:)
end
|
#follow_announcement_channel(channel_id:, json:) ⇒ Response
395
396
397
|
# File 'lib/lib_discord/channel.rb', line 395
def follow_announcement_channel(channel_id:, json:)
send_request(:post, "/channels/#{channel_id}/followers", json:)
end
|
#get_channel(channel_id:) ⇒ Response
29
30
31
|
# File 'lib/lib_discord/channel.rb', line 29
def get_channel(channel_id:)
send_request(:get, "/channels/#{channel_id}")
end
|
#get_channel_invites(channel_id:) ⇒ Response
343
344
345
|
# File 'lib/lib_discord/channel.rb', line 343
def get_channel_invites(channel_id:)
send_request(:get, "/channels/#{channel_id}/invites")
end
|
#get_channel_message(channel_id:, message_id:) ⇒ Response
99
100
101
|
# File 'lib/lib_discord/channel.rb', line 99
def get_channel_message(channel_id:, message_id:)
send_request(:get, "/channels/#{channel_id}/messages/#{message_id}")
end
|
#get_channel_messages(channel_id:, params: {}) ⇒ Response
81
82
83
|
# File 'lib/lib_discord/channel.rb', line 81
def get_channel_messages(channel_id:, params: {})
send_request(:get, "/channels/#{channel_id}/messages", params:)
end
|
#get_pinned_messages(channel_id:) ⇒ Response
425
426
427
|
# File 'lib/lib_discord/channel.rb', line 425
def get_pinned_messages(channel_id:)
send_request(:get, "/channels/#{channel_id}/pins")
end
|
#get_reactions(channel_id:, message_id:, emoji:, params: {}) ⇒ Response
216
217
218
|
# File 'lib/lib_discord/channel.rb', line 216
def get_reactions(channel_id:, message_id:, emoji:, params: {})
send_request(:get, "/channels/#{channel_id}/messages/#{message_id}/reactions/#{emoji}", params:)
end
|
#get_thread_member(channel_id:, user_id:, params: {}) ⇒ Response
640
641
642
|
# File 'lib/lib_discord/channel.rb', line 640
def get_thread_member(channel_id:, user_id:, params: {})
send_request(:get, "/channels/#{channel_id}/thread-members/#{user_id}", params:)
end
|
#group_dm_add_recipient(channel_id:, user_id:, json:) ⇒ Response
481
482
483
|
# File 'lib/lib_discord/channel.rb', line 481
def group_dm_add_recipient(channel_id:, user_id:, json:)
send_request(:put, "/channels/#{channel_id}/recipients/#{user_id}", json:)
end
|
#group_dm_remove_recipient(channel_id:, user_id:) ⇒ Response
499
500
501
|
# File 'lib/lib_discord/channel.rb', line 499
def group_dm_remove_recipient(channel_id:, user_id:)
send_request(:delete, "/channels/#{channel_id}/recipients/#{user_id}")
end
|
#join_thread(channel_id:) ⇒ Response
568
569
570
|
# File 'lib/lib_discord/channel.rb', line 568
def join_thread(channel_id:)
send_request(:put, "/channels/#{channel_id}/thread-members/@me")
end
|
#leave_thread(channel_id:) ⇒ Response
601
602
603
|
# File 'lib/lib_discord/channel.rb', line 601
def leave_thread(channel_id:)
send_request(:delete, "/channels/#{channel_id}/thread-members/@me")
end
|
#list_joined_private_archived_threads(channel_id:, params: {}) ⇒ Response
712
713
714
|
# File 'lib/lib_discord/channel.rb', line 712
def list_joined_private_archived_threads(channel_id:, params: {})
send_request(:get, "/channels/#{channel_id}/users/@me/threads/archived/private", params:)
end
|
#list_private_archived_threads(channel_id:, params: {}) ⇒ Response
694
695
696
|
# File 'lib/lib_discord/channel.rb', line 694
def list_private_archived_threads(channel_id:, params: {})
send_request(:get, "/channels/#{channel_id}/threads/archived/private", params:)
end
|
#list_public_archived_threads(channel_id:, params: {}) ⇒ Response
676
677
678
|
# File 'lib/lib_discord/channel.rb', line 676
def list_public_archived_threads(channel_id:, params: {})
send_request(:get, "/channels/#{channel_id}/threads/archived/public", params:)
end
|
#list_thread_members(channel_id:, params: {}) ⇒ Response
658
659
660
|
# File 'lib/lib_discord/channel.rb', line 658
def list_thread_members(channel_id:, params: {})
send_request(:get, "/channels/#{channel_id}/thread-members", params:)
end
|
#modify_channel(channel_id:, json:) ⇒ Response
46
47
48
|
# File 'lib/lib_discord/channel.rb', line 46
def modify_channel(channel_id:, json:)
send_request(:patch, "/channels/#{channel_id}", json:)
end
|
#pin_message(channel_id:, message_id:) ⇒ Response
443
444
445
|
# File 'lib/lib_discord/channel.rb', line 443
def pin_message(channel_id:, message_id:)
send_request(:put, "/channels/#{channel_id}/pins/#{message_id}")
end
|
#remove_thread_member(channel_id:, user_id:) ⇒ Response
619
620
621
|
# File 'lib/lib_discord/channel.rb', line 619
def remove_thread_member(channel_id:, user_id:)
send_request(:delete, "/channels/#{channel_id}/thread-members/#{user_id}")
end
|
#start_thread_from_message(channel_id:, message_id:, json:) ⇒ Response
519
520
521
|
# File 'lib/lib_discord/channel.rb', line 519
def start_thread_from_message(channel_id:, message_id:, json:)
send_request(:post, "/channels/#{channel_id}/messages/#{message_id}/threads", json:)
end
|
553
554
555
|
# File 'lib/lib_discord/channel.rb', line 553
def start_thread_in_forum_or_media_channel(channel_id:, json:)
send_request(:post, "/channels/#{channel_id}/threads", json:)
end
|
#start_thread_without_message(channel_id:, json:) ⇒ Response
536
537
538
|
# File 'lib/lib_discord/channel.rb', line 536
def start_thread_without_message(channel_id:, json:)
send_request(:post, "/channels/#{channel_id}/threads", json:)
end
|
#trigger_typing_indicator(channel_id:) ⇒ Response
410
411
412
|
# File 'lib/lib_discord/channel.rb', line 410
def trigger_typing_indicator(channel_id:)
send_request(:post, "/channels/#{channel_id}/typing")
end
|
#unpin_message(channel_id:, message_id:) ⇒ Response
461
462
463
|
# File 'lib/lib_discord/channel.rb', line 461
def unpin_message(channel_id:, message_id:)
send_request(:delete, "/channels/#{channel_id}/pins/#{message_id}")
end
|