Class: LibDiscord::User
Overview
Users Resource
Do not instantiate a User directly. Instead request one from an instance of Client.
client = LibDiscord::Client.new("Bot auth.token")
u = client["user"]
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#create_dm(json:) ⇒ Response
113
114
115
|
# File 'lib/lib_discord/user.rb', line 113
def create_dm(json:)
send_request(:post, "/users/@me/channels", json:)
end
|
#create_group_dm(json:) ⇒ Response
127
128
129
|
# File 'lib/lib_discord/user.rb', line 127
def create_group_dm(json:)
send_request(:post, "/users/@me/channels", json:)
end
|
#get_current_user ⇒ Response
25
26
27
|
# File 'lib/lib_discord/user.rb', line 25
def get_current_user
send_request(:get, "/users/@me")
end
|
#get_current_user_application_role_connection(application_id:) ⇒ Response
153
154
155
|
# File 'lib/lib_discord/user.rb', line 153
def get_current_user_application_role_connection(application_id:)
send_request(:get, "/users/@me/applications/#{application_id}/role-connections")
end
|
#get_current_user_connections ⇒ Response
138
139
140
|
# File 'lib/lib_discord/user.rb', line 138
def get_current_user_connections
send_request(:get, "/users/@me/connections")
end
|
#get_current_user_guild_member(guild_id:) ⇒ Response
84
85
86
|
# File 'lib/lib_discord/user.rb', line 84
def get_current_user_guild_member(guild_id:)
send_request(:get, "/users/@me/guilds/#{guild_id}/member")
end
|
#get_current_user_guilds(params: {}) ⇒ Response
69
70
71
|
# File 'lib/lib_discord/user.rb', line 69
def get_current_user_guilds(params: {})
send_request(:get, "/users/@me/guilds", params:)
end
|
#get_user(user_id:) ⇒ Response
40
41
42
|
# File 'lib/lib_discord/user.rb', line 40
def get_user(user_id:)
send_request(:get, "/users/#{user_id}")
end
|
#leave_guild(guild_id:) ⇒ Response
99
100
101
|
# File 'lib/lib_discord/user.rb', line 99
def leave_guild(guild_id:)
send_request(:delete, "/users/@me/guilds/#{guild_id}")
end
|
#modify_current_user(json:) ⇒ Response
54
55
56
|
# File 'lib/lib_discord/user.rb', line 54
def modify_current_user(json:)
send_request(:patch, "/users/@me", json:)
end
|
#update_current_user_application_role_connection(application_id:, json:) ⇒ Response
170
171
172
|
# File 'lib/lib_discord/user.rb', line 170
def update_current_user_application_role_connection(application_id:, json:)
send_request(:put, "/users/@me/applications/#{application_id}/role-connection", json:)
end
|