-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
49 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
function retrieve(c::Client, ::Type{AuditLog}, g::AbstractGuild; kwargs...) | ||
return get_guild_audit_log(c, g.id; kwargs...) | ||
end | ||
retrieve(c::Client, ::Type{AuditLog}, g::AbstractGuild; kwargs...) = get_guild_audit_log(c, g.id; kwargs...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
function create(c::Client, ::Type{Ban}, g::AbstractGuild, u::User; kwargs...) | ||
return create_guild_ban(c, g.id, u.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Ban}, g::AbstractGuild, u::User; kwargs...) = create_guild_ban(c, g.id, u.id; kwargs...) | ||
|
||
function retrieve(c::Client, ::Type{Ban}, g::AbstractGuild, u::User) | ||
return get_guild_ban(c, g.id, u.id) | ||
end | ||
retrieve(c::Client, ::Type{Ban}, g::AbstractGuild, u::User) = get_guild_ban(c, g.id, u.id) | ||
retrieve(c::Client, ::Type{Ban}, g::AbstractGuild) = get_guild_bans(c, g.id) | ||
|
||
function delete(c::Client, b::Ban, g::AbstractGuild) | ||
return remove_guild_ban(c, g.id, b.user.id) | ||
end | ||
delete(c::Client, b::Ban, g::AbstractGuild) = remove_guild_ban(c, g.id, b.user.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
function create(c::Client, ::Type{Emoji}, g::AbstractGuild; kwargs...) | ||
return create_guild_emoji(c, g.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Emoji}, g::AbstractGuild; kwargs...) = create_guild_emoji(c, g.id; kwargs...) | ||
|
||
function retrieve(c::Client, ::Type{Emoji}, g::AbstractGuild, e::Emoji) | ||
return get_guild_emoji(c, g.id, e.id) | ||
end | ||
function retrieve(c::Client, ::Type{Emoji}, g::AbstractGuild) | ||
return list_guild_emojis(c, g.id) | ||
end | ||
retrieve(c::Client, ::Type{Emoji}, g::AbstractGuild, e::Emoji) = get_guild_emoji(c, g.id, e.id) | ||
retrieve(c::Client, ::Type{Emoji}, g::AbstractGuild) = list_guild_emojis(c, g.id) | ||
|
||
function update(c::Client, e::Emoji, g::AbstractGuild; kwargs...) | ||
return modify_guild_emoji(c, g.id, e.id; kwargs...) | ||
end | ||
update(c::Client, e::Emoji, g::AbstractGuild; kwargs...) = modify_guild_emoji(c, g.id, e.id; kwargs...) | ||
|
||
function delete(c::Client, e::Emoji, g::AbstractGuild) | ||
return delete_guild_emoji(c, g.id, e.id) | ||
end | ||
delete(c::Client, e::Emoji, g::AbstractGuild) = delete_guild_emoji(c, g.id, e.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
retrieve(c::Client, ::Type{GuildEmbed}, g::AbstractGuild) = get_guild_embed(c, g.id) | ||
|
||
function update(c::Client, ::GuildEmbed, g::AbstractGuild; kwargs...) | ||
return modify_guild_embed(c, g.id; kwargs...) | ||
end | ||
update(c::Client, ::GuildEmbed, g::AbstractGuild; kwargs...) = modify_guild_embed(c, g.id; kwargs...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
function create(c::Client, ::Type{Integration}, g::AbstractGuild; kwargs...) | ||
return create_guild_integration(c, g.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Integration}, g::AbstractGuild; kwargs...) = create_guild_integration(c, g.id; kwargs...) | ||
|
||
retrieve(c::Client, ::Type{Integration}, g::AbstractGuild) = get_guild_integrations(c, g.id) | ||
|
||
function update(c::Client, i::Integration, g::AbstractGuild; kwargs...) | ||
return modify_guild_integration(c, g.id, i.id; kwargs...) | ||
end | ||
update(c::Client, i::Integration, g::AbstractGuild; kwargs...) = modify_guild_integration(c, g.id, i.id; kwargs...) | ||
|
||
function delete(c::Client, i::Integration, g::AbstractGuild) | ||
return delete_guild_integration(c, g.id, i.id) | ||
end | ||
delete(c::Client, i::Integration, g::AbstractGuild) = delete_guild_integration(c, g.id, i.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
function create(c::Client, ::Type{Invite}, ch::DiscordChannel; kwargs...) | ||
return create_channel_invite(c, ch.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Invite}, ch::DiscordChannel; kwargs...) = create_channel_invite(c, ch.id; kwargs...) | ||
|
||
retrieve(c::Client, ::Type{Invite}, g::AbstractGuild) = get_guild_invites(c, g.id) | ||
retrieve(c::Client, ::Type{Invite}, ch::DiscordChannel) = get_channel_invites(c, ch.id) | ||
function retrieve(c::Client, ::Type{Invite}, invite::AbstractString; kwargs...) | ||
return get_invite(c, invite; kwargs...) | ||
end | ||
retrieve(c::Client, ::Type{Invite}, invite::AbstractString; kwargs...) = get_invite(c, invite; kwargs...) | ||
|
||
delete(c::Client, i::Invite) = delete_invite(c, i.code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
function create(c::Client, ::Type{Member}, g::AbstractGuild, u::User; kwargs...) | ||
return add_guild_member(c, g.id, u.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Member}, g::AbstractGuild, u::User; kwargs...) = add_guild_member(c, g.id, u.id; kwargs...) | ||
|
||
function retrieve(c::Client, ::Type{Member}, g::AbstractGuild, u::User) | ||
return get_guild_member(c, g.id, u.id) | ||
end | ||
function retrieve(c::Client, ::Type{Member}, g::AbstractGuild) | ||
return list_guild_members(c, g.id) | ||
end | ||
retrieve(c::Client, ::Type{Member}, g::AbstractGuild, u::User) = get_guild_member(c, g.id, u.id) | ||
retrieve(c::Client, ::Type{Member}, g::AbstractGuild) = list_guild_members(c, g.id) | ||
|
||
function update(c::Client, m::Member, g::AbstractGuild; kwargs...) | ||
return modify_guild_member(c, g.id, m.user.id; kwargs...) | ||
end | ||
function update(c::Client, m::Member, r::Role, g::AbstractGuild) | ||
return add_guild_member_role(c, g.id, m.user.id, r.id) | ||
end | ||
update(c::Client, m::Member, g::AbstractGuild; kwargs...) = modify_guild_member(c, g.id, m.user.id; kwargs...) | ||
update(c::Client, m::Member, r::Role, g::AbstractGuild) = add_guild_member_role(c, g.id, m.user.id, r.id) | ||
|
||
function delete(c::Client, m::Member, g::AbstractGuild) | ||
return remove_guild_member(c, g.id, m.user.id) | ||
end | ||
function delete(c::Client, m::Member, r::Role, g::AbstractGuild) | ||
return remove_guild_member_role(c, g.id, m.user.id, r.id) | ||
end | ||
delete(c::Client, m::Member, g::AbstractGuild) = remove_guild_member(c, g.id, m.user.id) | ||
delete(c::Client, m::Member, r::Role, g::AbstractGuild) = remove_guild_member_role(c, g.id, m.user.id, r.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,23 @@ | ||
function create(c::Client, ::Type{Message}, ch::DiscordChannel; kwargs...) | ||
return create_message(c, ch.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Message}, ch::DiscordChannel; kwargs...) = create_message(c, ch.id; kwargs...) | ||
|
||
function retrieve(c::Client, ::Type{Message}, ch::DiscordChannel, message::Integer) | ||
return get_channel_message(c, ch.id, message) | ||
end | ||
function retrieve( | ||
retrieve(c::Client, ::Type{Message}, ch::DiscordChannel, message::Integer) = get_channel_message(c, ch.id, message) | ||
retrieve( | ||
c::Client, | ||
::Type{Message}, | ||
ch::DiscordChannel; | ||
pinned::Bool=false, | ||
kwargs..., | ||
) | ||
return if pinned | ||
) = if pinned | ||
get_pinned_messages(c, ch.id) | ||
else | ||
get_channel_messages(c, ch.id; kwargs...) | ||
end | ||
end | ||
|
||
update(c::Client, m::Message; kwargs...) = edit_message(c, m.channel_id, m.id; kwargs...) | ||
|
||
function delete(c::Client, m::Message; pinned::Bool=false) | ||
return if pinned | ||
delete(c::Client, m::Message; pinned::Bool=false) = if pinned | ||
delete_pinned_channel_message(c, m.channel_id, m.id) | ||
else | ||
delete_message(c, m.channel_id, m.id) | ||
end | ||
end | ||
function delete(c::Client, ms::Vector{Message}) | ||
return bulk_delete_messages(c, ms[1].channel_id; messages=map(m -> m.id, ms)) | ||
end | ||
delete(c::Client, ms::Vector{Message}) = bulk_delete_messages(c, ms[1].channel_id; messages = map(m -> m.id, ms)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,6 @@ | ||
function create(c::Client, ::Type{Overwrite}, ch::DiscordChannel, r::Role; kwargs...) | ||
return edit_channel_permissions(c, ch.id, r.id; kwargs..., type=OT_ROLE) | ||
end | ||
function create(c::Client, ::Type{Overwrite}, ch::DiscordChannel, u::User; kwargs...) | ||
return edit_channel_permissions(c, ch.id, u.id; kwargs..., type=OT_MEMBER) | ||
end | ||
create(c::Client, ::Type{Overwrite}, ch::DiscordChannel, r::Role; kwargs...) = edit_channel_permissions(c, ch.id, r.id; kwargs..., type = OT_ROLE) | ||
create(c::Client, ::Type{Overwrite}, ch::DiscordChannel, u::User; kwargs...) = edit_channel_permissions(c, ch.id, u.id; kwargs..., type = OT_MEMBER) | ||
|
||
function update(c::Client, o::Overwrite, ch::DiscordChannel; kwargs...) | ||
return edit_channel_permissions(c, ch.id, o.id; kwargs..., type=o.type) | ||
end | ||
update(c::Client, o::Overwrite, ch::DiscordChannel; kwargs...) = edit_channel_permissions(c, ch.id, o.id; kwargs..., type = o.type) | ||
|
||
function delete(c::Client, o::Overwrite, ch::DiscordChannel) | ||
return delete_channel_permission(c, ch.id, o.id) | ||
end | ||
delete(c::Client, o::Overwrite, ch::DiscordChannel) = delete_channel_permission(c, ch.id, o.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
function create(c::Client, ::Type{Role}, g::AbstractGuild; kwargs...) | ||
return create_guild_role(c, g.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Role}, g::AbstractGuild; kwargs...) = create_guild_role(c, g.id; kwargs...) | ||
|
||
retrieve(c::Client, ::Type{Role}, g::AbstractGuild) = get_guild_roles(c, g.id) | ||
|
||
function update(c::Client, r::Role, g::AbstractGuild; kwargs...) | ||
return modify_guild_role(c, g.id, r.id; kwargs...) | ||
end | ||
update(c::Client, r::Role, g::AbstractGuild; kwargs...) = modify_guild_role(c, g.id, r.id; kwargs...) | ||
|
||
delete(c::Client, r::Role, g::AbstractGuild) = delete_guild_role(c, g.id, r.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
function retrieve(c::Client, ::Type{User}, user::Integer) | ||
return if me(c) !== nothing && me(c).id == user | ||
retrieve(c::Client, ::Type{User}, user::Integer) = if me(c) !== nothing && me(c).id == user | ||
get_current_user(c) | ||
else | ||
get_user(c, user) | ||
end | ||
end | ||
retrieve(c::Client, ::Type{User}) = get_current_user(c) | ||
|
||
update(c::Client; kwargs...) = modify_current_user(c; kwargs...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
function retrieve(c::Client, ::Type{VoiceRegion}, g::AbstractGuild) | ||
return get_guild_voice_regions(c, g.id) | ||
end | ||
retrieve(c::Client, ::Type{VoiceRegion}, g::AbstractGuild) = get_guild_voice_regions(c, g.id) | ||
retrieve(c::Client, ::Type{VoiceRegion}) = list_voice_regions(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
function create(c::Client, ::Type{Webhook}, ch::DiscordChannel; kwargs...) | ||
return create_webhook(c, ch.id; kwargs...) | ||
end | ||
create(c::Client, ::Type{Webhook}, ch::DiscordChannel; kwargs...) = create_webhook(c, ch.id; kwargs...) | ||
|
||
retrieve(c::Client, ::Type{Webhook}, ch::DiscordChannel) = get_channel_webhooks(c, ch.id) | ||
retrieve(c::Client, ::Type{Webhook}, g::AbstractGuild) = get_guild_webhooks(c, g.id) | ||
retrieve(c::Client, ::Type{Webhook}, webhook::Integer) = get_webhook(c, webhook) | ||
function retrieve(c::Client, ::Type{Webhook}, webhook::Integer, token::AbstractString) | ||
return get_webhook_with_token(c, webhook, token) | ||
end | ||
retrieve(c::Client, ::Type{Webhook}, webhook::Integer, token::AbstractString) = get_webhook_with_token(c, webhook, token) | ||
|
||
update(c::Client, w::Webhook; kwargs...) = modify_webhook(c, w.id; kwargs...) | ||
function update(c::Client, w::Webhook, token::AbstractString; kwargs...) | ||
return modify_webhook_with_token(c, w.id, token; kwargs...) | ||
end | ||
update(c::Client, w::Webhook, token::AbstractString; kwargs...) = modify_webhook_with_token(c, w.id, token; kwargs...) | ||
|
||
delete(c::Client, w::Webhook) = delete_webhook(c, w.id) | ||
function delete(c::Client, w::Webhook, token::AbstractString) | ||
return delete_webhook_with_token(c, w.id, token) | ||
end | ||
delete(c::Client, w::Webhook, token::AbstractString) = delete_webhook_with_token(c, w.id, token) |