From 2ba022d3180ea1c0d883599eb9673241ddddd4b5 Mon Sep 17 00:00:00 2001 From: TheGreenCat Date: Fri, 25 Dec 2020 22:07:40 +0000 Subject: [PATCH] Added guild template endpoints, stickers, user flags enum, message reference in sendmessage, couple of changes as well --- CONTRIBUTING.md | 2 +- dimscord/constants.nim | 37 ++- dimscord/dispatch.nim | 8 +- dimscord/gateway.nim | 22 +- dimscord/helpers.nim | 10 +- dimscord/objects.nim | 33 ++- dimscord/objects/typedefs.nim | 16 +- dimscord/restapi/guild.nim | 53 +++- dimscord/restapi/message.nim | 32 ++- dimscord/restapi/requester.nim | 6 +- dimscord/restapi/user.nim | 2 +- docs/dimscord.html | 4 +- docs/dimscord/constants.html | 405 ++++++++++++++++----------- docs/dimscord/constants.idx | 21 ++ docs/dimscord/dispatch.html | 2 +- docs/dimscord/gateway.html | 2 +- docs/dimscord/helpers.html | 22 +- docs/dimscord/objects.html | 405 ++++++++++++++++----------- docs/dimscord/objects.idx | 3 + docs/dimscord/restapi.html | 255 +++++++++++++---- docs/dimscord/restapi/requester.html | 22 +- docs/dimscord/restapi/user.html | 2 +- docs/dimscord/voice.html | 2 +- docs/theindex.html | 140 ++++++++- 24 files changed, 1028 insertions(+), 478 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 93a640b..b11bb08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,5 +13,5 @@ #### Please Do NOT: * Make spam comments or less detailed issues. -* Make command handler PRs or issues. There is no need for a command handler (read https://github.com/krisppurg/dimscord/pull/6#issuecomment-620716071) +* Make command handler PRs or issues. [There is already a command handler](https://github.com/ire4ever1190/dimscmd) * Make lines over 80-81 characters, unless it's comments which limits to around 120 characters. diff --git a/dimscord/constants.nim b/dimscord/constants.nim index 6f6db43..c856a3d 100644 --- a/dimscord/constants.nim +++ b/dimscord/constants.nim @@ -78,6 +78,21 @@ type mfSupressEmbeds, mfSourceMessageDeleted mfUrgent + UserFlags* = enum + ufNone, + ufDiscordEmployee, + ufPartneredServerOwner, + ufHypesquadEvents, + ufBugHunterLevel1, + ufHouseBravery = 64, + ufHouseBrilliance, + ufHouseBalance, + ufEarlySupporter, + ufTeamUser, + ufSystem = 4096 + ufBugHunterLevel2 = 16384 + ufVerifiedBot = 65536, + ufEarlyVerifiedBotDeveloper const libName* = "Dimscord" libVer* = "1.2.0" @@ -201,6 +216,10 @@ type TeamMembershipState* = enum tmsInvited = 1 # not to be confused with "The Mysterious Song" lol tmsAccepted = 2 + MessageStickerFormat* = enum + msfPng = 1 + msfAPng = 2 + msfLottie = 3 ApplicationCommandOptionType* = enum acotSubCommand = 1 acotSubCommandGroup = 2 @@ -299,7 +318,7 @@ proc endpointGuildAuditLogs*(gid: string): string = result = endpointGuilds(gid) & "/audit-logs" proc endpointGuildMembers*(gid: string; mid = ""): string = - result = endpointGuilds(gid) & "/members" & (if mid != "": "/" & mid else: "") + result = endpointGuilds(gid) & "/members" & (if mid != "":"/"&mid else: "") proc endpointGuildMembersNick*(gid: string; mid = "@me"): string = result = endpointGuildMembers(gid, mid) & "/nick" @@ -308,7 +327,7 @@ proc endpointGuildMembersRole*(gid, mid, rid: string): string = result = endpointGuildMembers(gid, mid) & "/roles/" & rid proc endpointGuildIntegrations*(gid: string; iid = ""): string = - result = endpointGuilds(gid) & "/integrations" & (if iid != "": "/" & iid else: "") + result = endpointGuilds(gid)&"/integrations"&(if iid!="":"/"&iid else:"") proc endpointGuildIntegrationsSync*(gid, iid: string): string = result = endpointGuildIntegrations(gid, iid) & "/sync" @@ -317,10 +336,10 @@ proc endpointGuildWidget*(gid: string): string = result = endpointGuilds(gid) & "/widget" proc endpointGuildEmojis*(gid: string; eid = ""): string = - result = endpointGuilds(gid) & "/emojis" & (if eid != "": "/" & eid else: "") + result = endpointGuilds(gid)&"/emojis"&(if eid != "": "/" & eid else: "") proc endpointGuildRoles*(gid: string; rid = ""): string = - result = endpointGuilds(gid) & "/roles" & (if rid != "": "/" & rid else: "") + result = endpointGuilds(gid) & "/roles" & (if rid!="": "/" & rid else: "") proc endpointGuildPrune*(gid: string): string = result = endpointGuilds(gid) & "/prune" @@ -335,7 +354,7 @@ proc endpointGuildVanity*(gid: string): string = result = endpointGuilds(gid) & "/vanity-url" proc endpointGuildChannels*(gid: string; cid = ""): string = - result = endpointGuilds(gid) & "/channels" & (if cid != "": "/" & cid else: "") + result = endpointGuilds(gid) & "/channels" & (if cid != "":"/"&cid else:"") proc endpointChannelOverwrites*(cid, oid: string): string = result = endpointChannels(cid) & "/permissions/" & oid @@ -346,6 +365,9 @@ proc endpointWebhooks*(wid: string): string = proc endpointChannelWebhooks*(cid: string): string = result = endpointChannels(cid) & "/webhooks" +proc endpointGuildTemplates*(gid, tid = ""): string = + result = endpointGuilds(gid) & "/templates" & (if tid!="": "/"&tid else:"") + proc endpointGuildWebhooks*(gid: string): string = result = endpointGuilds(gid) & "/webhooks" @@ -365,6 +387,9 @@ proc endpointChannelMessages*(cid: string; mid = ""): string = result = endpointChannels(cid) & "/messages" if mid != "": result = result & "/" & mid +proc endpointChannelMessagesCrosspost*(cid, mid: string): string = + result = endpointChannelMessages(cid, mid) & "/crosspost" + proc endpointChannelInvites*(cid: string): string = result = endpointChannels(cid) & "/invites" @@ -399,7 +424,7 @@ proc endpointOAuth2Application*(): string = result = "oauth2/applications/@me" proc endpointGlobalCommands*(aid: string; cid = ""): string = - result = "applications/" & aid & "/commands" & (if cid != "": "/" & cid else: "") + result = "applications/" & aid & "/commands" & (if cid!="":"/"&cid else:"") proc endpointGuildCommands*(aid, gid: string; cid = ""): string = result = "applications/" & aid & "/guilds/" & gid & "/commands" diff --git a/dimscord/dispatch.nim b/dimscord/dispatch.nim index 083bdaf..04f30b8 100644 --- a/dimscord/dispatch.nim +++ b/dimscord/dispatch.nim @@ -692,10 +692,10 @@ proc handleEventDispatch*(s: Shard, event: string, data: JsonNode) {.async.} = of "GUILD_EMOJIS_UPDATE": await s.guildEmojisUpdate(data) of "PRESENCE_UPDATE": await s.presenceUpdate(data) of "MESSAGE_CREATE": await s.messageCreate(data) - of "MESSAGE_REACTION_ADD": await s.messageReactionAdd(data) - of "MESSAGE_REACTION_REMOVE": await s.messageReactionRemove(data) - of "MESSAGE_REACTION_REMOVE_EMOJI": await s.messageReactionRemoveEmoji(data) - of "MESSAGE_REACTION_REMOVE_ALL": await s.messageReactionRemoveAll(data) + of "MESSAGE_REACTION_ADD": await s.messageReactionAdd data + of "MESSAGE_REACTION_REMOVE": await s.messageReactionRemove data + of "MESSAGE_REACTION_REMOVE_EMOJI": await s.messageReactionRemoveEmoji data + of "MESSAGE_REACTION_REMOVE_ALL": await s.messageReactionRemoveAll data of "MESSAGE_DELETE": await s.messageDelete(data) of "MESSAGE_UPDATE": await s.messageUpdate(data) of "MESSAGE_DELETE_BULK": await s.messageDeleteBulk(data) diff --git a/dimscord/gateway.nim b/dimscord/gateway.nim index f4acf40..6acc294 100644 --- a/dimscord/gateway.nim +++ b/dimscord/gateway.nim @@ -409,7 +409,7 @@ proc handleSocketMessage(s: Shard) {.async.} = var packet: (Opcode, string) - shouldReconnect = s.client.autoreconnect + autoreconnect = s.client.autoreconnect while not s.sockClosed: try: @@ -444,14 +444,14 @@ proc handleSocketMessage(s: Shard) {.async.} = if not s.hbAck: s.logShard("A zombied connection was detected.") else: - s.logShard("An error occurred while parsing data: " & packet[1]) - shouldReconnect = s.handleDisconnect(packet[1]) + s.logShard("An error occurred while parsing data: "&packet[1]) + autoreconnect = s.handleDisconnect(packet[1]) - await s.disconnect(should_reconnect = shouldReconnect) + await s.disconnect(should_reconnect = autoreconnect) break if data["s"].kind != JNull and not s.resuming: - s.sequence = data["s"].getInt() + s.sequence = data["s"].getInt case data["op"].num: of opHello: @@ -469,13 +469,13 @@ proc handleSocketMessage(s: Shard) {.async.} = s.hbAck = true of opHeartbeat: s.logShard("Discord is requesting for a heartbeat.") - await s.heartbeat(true) + await s.heartbeat true of opDispatch: asyncCheck s.handleDispatch(data["t"].str, data["d"]) of opReconnect: s.logShard("Discord is requesting for a client reconnect.") - await s.disconnect(should_reconnect = shouldReconnect) + await s.disconnect(should_reconnect = autoreconnect) await s.client.events.on_disconnect(s) of opInvalidSession: var interval = 5000 @@ -506,13 +506,13 @@ proc handleSocketMessage(s: Shard) {.async.} = raise newException(Exception, "Fatal error occurred.") if packet[0] == Close: - if not shouldReconnect: - shouldReconnect = s.handleDisconnect(packet[1]) + if not autoreconnect: + autoreconnect = s.handleDisconnect(packet[1]) s.stop = true s.reset() - if shouldReconnect: + if autoreconnect: await s.reconnect() await sleepAsync 2000 @@ -628,7 +628,7 @@ proc startSession*(discord: DiscordClient, log("WARNING: Your session start limit has reached to 10.") if info.session_start_limit.remaining == 0: - let time = getTime().toUnix() - info.session_start_limit.reset_after + let time = getTime().toUnix()-info.session_start_limit.reset_after log("Your session start limit has reached its limit", ( sleep_time: time diff --git a/dimscord/helpers.nim b/dimscord/helpers.nim index 1774baa..ba224f2 100644 --- a/dimscord/helpers.nim +++ b/dimscord/helpers.nim @@ -153,7 +153,8 @@ proc computePerms*(guild: Guild, member: Member): PermObj = result = PermObj(allowed: perms) -proc computePerms*(guild: Guild, member: Member, channel: GuildChannel): PermObj = +proc computePerms*(guild: Guild; + member: Member, channel: GuildChannel): PermObj = ## Returns the permissions for the guild member of the channel. ## For permission checking you can do something like this: ## @@ -185,9 +186,12 @@ proc computePerms*(guild: Guild, member: Member, channel: GuildChannel): PermObj deny = deny or cast[int](overwrites[m].deny) perms = (perms and deny - deny - deny - 1) or allow - result = PermObj(allowed: cast[set[PermissionFlags]](allow), denied: cast[set[PermissionFlags]](deny)) + result = PermObj( + allowed: cast[set[PermissionFlags]](allow), + denied: cast[set[PermissionFlags]](deny) + ) -proc createBotInvite*(client_id: string, permissions: set[PermissionFlags] = {}; +proc createBotInvite*(client_id: string, permissions: set[PermissionFlags]={}; guild_id = ""; disable_guild_select = false): string = ## Creates an invite link for the bot of the form. ## diff --git a/dimscord/objects.nim b/dimscord/objects.nim index 8114c90..cc4e3ae 100644 --- a/dimscord/objects.nim +++ b/dimscord/objects.nim @@ -103,7 +103,7 @@ proc newDiscordClient*(token: string; r: Role) {.async.} = discard, guild_role_update: proc (s: Shard, g: Guild, r: Role, o: Option[Role]) {.async.} = discard, - invite_create: proc (s: Shard, i: InviteCreate) {.async.} = discard, + invite_create: proc(s: Shard, i: InviteCreate) {.async.} = discard, invite_delete: proc (s: Shard, g: Option[Guild], c, code: string) {.async.} = discard, user_update: proc (s: Shard, u: User) {.async.} = discard, @@ -115,7 +115,7 @@ proc newDiscordClient*(token: string; webhooks_update: proc (s: Shard, g: Guild, c: GuildChannel) {.async.} = discard, on_disconnect: proc (s: Shard) {.async.} = discard, - interaction_create: proc (s:Shard, i:Interaction){.async.} = discard + interaction_create: proc(s:Shard, i:Interaction){.async.} = discard )) proc newInviteMetadata*(data: JsonNode): InviteMetadata = @@ -152,7 +152,9 @@ proc newRole*(data: JsonNode): Role = mentionable: data["mentionable"].bval ) when defined(discordv8): - result.permissions = cast[set[PermissionFlags]](data["permissions"].str.parseInt) + result.permissions = cast[set[PermissionFlags]]( + data["permissions"].str.parseInt + ) else: result.permissions = cast[set[PermissionFlags]]( data["permissions"].getInt @@ -482,6 +484,10 @@ proc newMessage*(data: JsonNode): Message = pinned: data["pinned"].bval, kind: MessageType data["type"].getInt, flags: cast[set[MessageFlags]](data["flags"].getInt), + stickers: data{"stickers"}.getElems.map( + proc (x: JsonNode): Sticker = + x.to(Sticker) + ), reactions: initTable[string, Reaction]() ) data.keyCheckOptStr(result, edited_timestamp, @@ -491,6 +497,8 @@ proc newMessage*(data: JsonNode): Message = result.author = newUser(data["author"]) if "member" in data and data["member"].kind != JNull: result.member = some newMember(data["member"]) + if "referenced_message" in data and data["referenced_message"].kind!=JNull: + result.referenced_message = some data["referenced_message"].newMessage for r in data{"mention_roles"}.getElems: result.mention_roles.add(r.str) @@ -703,6 +711,21 @@ proc newGuild*(data: JsonNode): Guild = result.members[uid].presence = presence result.presences[uid] = presence +proc newGuildTemplate*(data: JsonNode): GuildTemplate = + result = GuildTemplate( + code: data["code"].str, + name: data["name"].str, + usage_count: data["usage_count"].getInt, + creator_id: data["creator_id"].str, + creator: newUser(data["creator"]), + created_at: data["created_at"].str, + updated_at: data["updated_at"].str, + source_guild_id: data["source_guild_id"].str, + serialized_source_guild:data["serialized_source_guild"].to PartialGuild + ) + data.keyCheckOptBool(result, is_dirty) + data.keyCheckOptStr(result, description) + proc newApplicationCommandInteractionDataOption( data: JsonNode ): ApplicationCommandInteractionDataOption = @@ -758,8 +781,8 @@ proc newApplicationCommandOption*(data: JsonNode): ApplicationCommandOption = result = ApplicationCommandOptionChoice( name: x["name"].str) if x["value"].kind == JInt: - result.value[1] = some x["value"].getInt # this is a tuple btw - if x["value"].kind == JString: + result.value[1] = some x["value"].getInt # this is + if x["value"].kind == JString: # a tuple btw result.value[0] = some x["value"].str ), options: data{"options"}.getElems.map newApplicationCommandOption diff --git a/dimscord/objects/typedefs.nim b/dimscord/objects/typedefs.nim index 4b4c132..2762da3 100644 --- a/dimscord/objects/typedefs.nim +++ b/dimscord/objects/typedefs.nim @@ -121,6 +121,8 @@ type activity*: Option[tuple[kind: int, party_id: string]] application*: Option[Application] message_reference*: Option[MessageReference] + stickers*: seq[Sticker] + referenced_message*: Option[Message] User* = ref object id*, username*, discriminator*: string bot*, system*: bool @@ -152,6 +154,11 @@ type Application* = object id*, cover_image*: string description*, icon*, name*: string + Sticker* = object + id*, pack_id*: string + name*, description*: string + tags*, asset*, format_asset*: Option[string] + format_type*: MessageStickerFormat RestApi* = ref object token*: string endpoints*: Table[string, Ratelimit] @@ -242,6 +249,14 @@ type color*, position*: int permissions*: set[PermissionFlags] hoist*, managed*, mentionable*: bool + GuildTemplate* = object + code*, name*, creator_id*: string + description*: Option[string] + usage_count*: int + creator*: User + source_guild_id*, updated_at*, created_at*: string + serialized_source_guild*: PartialGuild + is_dirty*: Option[bool] ActivityStatus* = object ## This is used for status updates. name*: string @@ -292,7 +307,6 @@ type name*, description*: string options*: seq[ApplicationCommandOption] ApplicationCommandOption* = object - ## `choices` reference: Table[choice_name, (Some("..."), None[int])] kind*: ApplicationCommandOptionType name*, description*: string default*, required*: Option[bool] diff --git a/dimscord/restapi/guild.nim b/dimscord/restapi/guild.nim index 99c7714..5ebeecc 100644 --- a/dimscord/restapi/guild.nim +++ b/dimscord/restapi/guild.nim @@ -323,13 +323,12 @@ proc deleteGuildIntegration*(api: RestApi, integ_id: string; ) proc getGuildWidget*(api: RestApi, - guild_id: string): Future[tuple[enabled: bool, - channel_id: Option[string]]] {.async.} = + guild_id: string): Future[GuildWidgetJson] {.async.} = ## Gets a guild widget. result = (await api.request( "GET", endpointGuildWidget(guild_id) - )).to(tuple[enabled: bool, channel_id: Option[string]]) + )).to(GuildWidgetJson) proc editGuildWidget*(api: RestApi, guild_id: string, enabled = none bool; @@ -442,3 +441,51 @@ proc getVoiceRegions*(api: RestApi): Future[seq[VoiceRegion]] {.async.} = proc (x: JsonNode): VoiceRegion = x.to(VoiceRegion) ) + +proc createGuildFromTemplate*(api: RestApi; + code: string): Future[Guild] {.async.} = + ## Create a guild from a template, this endpoint is used for bots + ## that are in >10 guilds + result = (await api.request( + "POST", endpointGuildTemplates(tid=code) + )).newGuild + +proc getGuildTemplate*(api: RestApi; + code: string): Future[GuildTemplate] {.async.} = + ## Get guild template from its code. + result = (await api.request( + "GET", endpointGuildTemplates(tid=code) + )).newGuildTemplate + +proc createGuildTemplate*(api: RestApi; + guild_id, name: string; + description = none string): Future[GuildTemplate] {.async.} = + ## Create a guild template + result = (await api.request( + "POST", endpointGuildTemplates(gid=guild_id) + )).newGuildTemplate + +proc syncGuildTemplate*(api: RestApi; + guild_id, code: string): Future[GuildTemplate] {.async.} = + ## Sync guild template. + result = (await api.request( + "PUT", endpointGuildTemplates(gid=guild_id,tid=code) + )).newGuildTemplate + +proc editGuildTemplate*(api: RestApi; + guild_id, code: string; + name, description = none string): Future[GuildTemplate] {.async.} = + ## Modify a guild template. + let payload = newJObject() + payload.loadNullableOptStr(description) + if name.isSome: payload["name"] = %name + result = (await api.request( + "PATCH", endpointGuildTemplates(gid=guild_id,tid=code) + )).newGuildTemplate + +proc deleteGuildTemplate*(api: RestApi; + guild_id, code: string): Future[GuildTemplate] {.async.} = + ## Delete guild template. + result = (await api.request( + "DELETE", endpointGuildTemplates(gid=guild_id,tid=code) + )).newGuildTemplate \ No newline at end of file diff --git a/dimscord/restapi/message.nim b/dimscord/restapi/message.nim index 2a0e3be..557ade1 100644 --- a/dimscord/restapi/message.nim +++ b/dimscord/restapi/message.nim @@ -4,10 +4,12 @@ import tables, os, sequtils import uri, ../helpers, requester proc sendMessage*(api: RestApi, channel_id: string; - content = ""; tts = false; embed = none Embed; - allowed_mentions = none AllowedMentions; - nonce: Option[string] or Option[int] = none(int); - files = none seq[DiscordFile]): Future[Message] {.async.} = + content = ""; tts = false; embed = none Embed; + allowed_mentions = none AllowedMentions; + nonce: Option[string] or Option[int] = none(int); + files = none seq[DiscordFile]; + message_reference = none MessageReference +): Future[Message] {.async.} = ## Sends a discord message. ## - `nonce` This can be used for optimistic message sending let payload = %*{ @@ -17,12 +19,12 @@ proc sendMessage*(api: RestApi, channel_id: string; if embed.isSome: payload["embed"] = %get embed - if allowed_mentions.isSome: payload["allowed_mentions"] = %get allowed_mentions - if nonce.isSome: payload["nonce"] = %get nonce + if message_reference.isSome: + payload["message_reference"] = %message_reference if files.isSome: var mpd = newMultipartData() @@ -74,6 +76,14 @@ proc editMessage*(api: RestApi, channel_id, message_id: string; $payload )).newMessage +proc crosspostMessage*(api: RestApi; + channel_id, message_id: string): Future[Message] {.async.} = + ## Crosspost channel message aka publish messages into news channels. + result = (await api.request( + "POST", + endpointChannelMessagesCrosspost(channel_id, message_id) + )).newMessage + proc deleteMessage*(api: RestApi, channel_id, message_id: string; reason = "") {.async.} = ## Deletes a discord message. @@ -241,9 +251,9 @@ proc editWebhookMessage*(api: RestApi; ## You can actually use this to modify ## original interaction or followup message. ## - ## `webhook_id` can also be application_id - ## `webhook_token` can also be interaction token. - ## `message_id` can be `@original` + ## - `webhook_id` can also be application_id + ## - `webhook_token` can also be interaction token. + ## - `message_id` can be `@original` discard await api.request( "PATCH", endpointWebhookMessage(webhook_id, webhook_token, message_id), $(%*{ @@ -259,8 +269,8 @@ proc deleteWebhookMessage*(api: RestApi; ## You can actually use this to delete ## original interaction or followup message. ## - ## `webhook_id` can also be application_id - ## `webhook_token` can also be interaction token. + ## - `webhook_id` can also be application_id + ## - `webhook_token` can also be interaction token. discard await api.request( "DELETE", endpointWebhookMessage(webhook_id, webhook_token, message_id) diff --git a/dimscord/restapi/requester.nim b/dimscord/restapi/requester.nim index b535511..9b94cbf 100644 --- a/dimscord/restapi/requester.nim +++ b/dimscord/restapi/requester.nim @@ -159,7 +159,8 @@ proc request*(api: RestApi, meth, endpoint: string; let body = resp.body if (await withTimeout(body, 60_000)) == false: - raise newException(RestError, "Body took too long to parse.") + raise newException(RestError, + "Body took too long to parse.") else: data = (await body).parseJson @@ -209,7 +210,8 @@ proc request*(api: RestApi, meth, endpoint: string; let body = resp.body if (await withTimeout(body, 60_000)) == false: - raise newException(RestError, "Body took too long to parse.") + raise newException(RestError, + "Body took too long to parse.") else: data = (await body).parseJson else: diff --git a/dimscord/restapi/user.nim b/dimscord/restapi/user.nim index ca02dbe..38e7330 100644 --- a/dimscord/restapi/user.nim +++ b/dimscord/restapi/user.nim @@ -57,7 +57,7 @@ proc leaveGuild*(api: RestApi, guild_id: string) {.async.} = ## Leaves a guild. discard await api.request("DELETE", endpointUserGuilds(guild_id)) -proc createUserDm*(api: RestApi, user_id: string): Future[DMChannel] {.async.} = +proc createUserDm*(api: RestApi, user_id: string): Future[DMChannel]{.async.} = ## Create user dm. result = (await api.request("POST", endpointUserChannels(), $(%*{ "recipient_id": user_id diff --git a/docs/dimscord.html b/docs/dimscord.html index 9dd6821..de2cdf9 100644 --- a/docs/dimscord.html +++ b/docs/dimscord.html @@ -155,7 +155,7 @@

Imports

Exports

-resume, endSession, updateStatus, dimscord/gateway, disconnect, requestGuildMembers, voiceStateUpdate, updateStatus, latency, startSession, createGuildChannel, getGuildVoiceRegions, deleteMessageReaction, getGuildInvites, getChannelMessages, getGuildIntegrations, getGuildVanityUrl, editApplicationCommand, getGuildChannel, editGuildWidget, getGateway, deleteWebhook, getChannelMessage, getVoiceRegions, beginGuildPrune, syncGuildIntegration, deleteGuildRole, editWebhookMessage, editGuildRole, getGuildBan, getGuildWidget, createInteractionResponse, registerApplicationCommand, createChannelInvite, getWebhook, deleteGuildIntegration, getGuildBans, deleteMessageReactionEmoji, getGuildRoles, addMessageReaction, editCurrentUser, createGuild, getChannelWebhooks, deleteApplicationCommand, deleteChannel, getChannelInvites, deleteGuild, leaveGuild, getInvite, getApplicationCommands, editGuildIntegration, createGuildBan, getGuildAuditLogs, deleteAllMessageReactions, editGuild, deleteGuildEmoji, executeWebhook, createGuildEmoji, getGuild, editGuildChannelPositions, getGuildMember, createWebhook, editGuildChannel, deleteGuildChannelPermission, getGuildPreview, editGuildChannelPermissions, editWebhook, editGuildMember, getMessageReactions, createUserDm, getGuildChannels, addGuildMember, bulkDeleteMessages, getGatewayBot, getChannelPins, createGroupDm, sendMessage, triggerTypingIndicator, addChannelMessagePin, executeSlackWebhook, deleteChannelMessagePin, getGuildWebhooks, getGuildPruneCount, deleteMessage, dimscord/restapi, removeGuildMember, getGuildMembers, deleteInvite, getUser, editGuildRolePosition, executeGithubWebhook, setGuildNick, createGuildRole, editMessage, editGuildEmoji, deleteWebhookMessage, getCurrentApplication, removeGuildMemberRole, removeGuildBan, getCurrentUser, addGuildMemberRole, irtChannelMessage, aleRoleCreate, endpointGuildRegions, vlNone, endpointGuildWidget, permManageNicknames, cdnIcons, tmsAccepted, endpointUserChannels, giGuildIntegrations, permAll, afSync, ctGroupDM, permManageGuild, giGuilds, atCustom, aleRoleUpdate, aleMemberUpdate, mtUserGuildBoostTier3, IntegrationExpireBehavior, acotRole, giGuildMessageReactions, giGuildMessages, endpointBulkDeleteMessages, permReadMessageHistory, endpointGuildBans, aleIntegrationDelete, endpointGuildIntegrationsSync, alcRoles, ptNone, cdnAppAssets, giGuildWebhooks, InteractionType, mtReply, permViewAuditLogs, cdnSplashes, endpointGuildCommands, ctDirect, endpointGuildMembersRole, permManageMessages, ecfMembersWithoutRoles, cdnAvatars, giGuildEmojis, ptTier2, endpointGuildChannels, endpointWebhookTokenSlack, aleMemberRoleUpdate, acotInt, aleRoleDelete, mfIsCrosspost, permVoiceDeafenMembers, cdnAttachments, permSendMessages, permPrioritySpeaker, aleWebhookCreate, matJoinRequest, giDirectMessageReactions, permVoiceMoveMembers, cdnChannelIcons, endpointGuildEmojis, mtUserGuildBoost, endpointGuildPreview, aleWebhookDelete, aleInviteDelete, aleEmojiUpdate, cdnAppIcons, endpointGuildMembersNick, mtGuildDiscoveryDisqualified, WebhookType, permAttachFiles, acotUser, aleChannelOverwriteUpdate, afJoinRequest, endpointWebhooks, aleBotAdd, ActivityType, endpointWebhookTokenGithub, permViewChannel, AuditLogChangeType, log, aleChannelCreate, permManageChannels, endpointGuildWebhooks, ctGuildText, permEmbedLinks, itPing, permVoiceMuteMembers, endpointChannelPins, ActivityFlags, aleChannelOverwriteCreate, endpointOAuth2Application, aleMemberPrune, endpointVoiceRegions, aleMemberBanRemove, mtGuildMemberJoin, alcInt, acotSubCommand, mtDefault, aleMessageUnpin, permMentionEveryone, aleIntegrationCreate, endpointInvites, aleMemberMove, VoiceSpeakingFlags, whIncoming, MessageActivityType, irtChannelMessageWithSource, whFollower, alcString, permChangeNickname, ChannelType, permCreateInstantInvite, permKickMembers, permUseVAD, afPlay, afJoin, vlMedium, vsfPriority, acotStr, ptTier1, irtAcknowledge, mtChannelIconChange, endpointUserGuilds, itApplicationCommand, permSendTTSMessage, aleWebhookUpdate, permVoiceStream, mfCrossposted, mtGuildDiscoveryRequalified, mtCall, mnlOnlyMentions, endpointTriggerTyping, atPlaying, aleEmojiCreate, endpointGuildVanity, atListening, mtChannelNameChange, ctGuildNews, endpointChannelPermissions, giGuildMessageTyping, mtUserGuildBoostTier1, InteractionResponseType, endpointChannelInvites, endpointGuildIntegrations, vlVeryHigh, log, mfSupressEmbeds, aleGuildUpdate, acotBool, permAllVoice, endpointGuildInvites, permManageRoles, mtChannelPinnedMessage, endpointWebhookMessage, giGuildVoiceStates, MessageType, atWatching, alcBool, matJoin, endpointReactions, permVoiceSpeak, irtAckWithSource, cdnDiscoverySplashes, permManageEmojis, giGuildPresences, permViewGuildInsights, matSpectate, aleIntegrationUpdate, vsfMicrophone, endpointChannelOverwrites, iebRemoveRole, restBase, aleMemberKick, endpointChannelMessages, endpointUsers, permUseExternalEmojis, afSpectate, MessageFlags, aleMessageDelete, mtApplicationCommand, endpointGroupRecipient, permAddReactions, alcNil, libVer, aleEmojiDelete, VerificationLevel, ctGuildStore, acotChannel, MessageNotificationLevel, endpointGuildMembers, mtUserGuildBoostTier2, iebKick, permAllText, mfaElevated, irtPong, giGuildInvites, endpointWebhookToken, acotSubCommandGroup, MFALevel, endpointGlobalCommands, mnlAllMessages, vlHigh, ecfDisabled, ctGuildVoice, ctGuildParent, ecfAllMembers, permVoiceConnect, ExplicitContentFilter, tmsInvited, endpointGuildAuditLogs, aleMemberBanAdd, AuditLogEntryType, mtRecipientAdd, permManageWebhooks, PermissionFlags, endpointGuildRoles, libName, aleMemberDisconnect, permAdministrator, PremiumTier, mfaNone, atStreaming, aleMessagePin, endpointChannelWebhooks, cdnBase, giGuildBans, aleInviteCreate, cdnTeamIcons, mfUrgent, endpointChannels, libAgent, endpointGuilds, cdnCustomEmojis, cdnDefaultUserAvatars, ApplicationCommandOptionType, alcOverwrites, GatewayIntent, mfSourceMessageDeleted, endpointGuildPrune, mtChannelFollowAdd, aleInviteUpdate, giGuildMembers, mtRecipientRemove, giDirectMessageTyping, aleChannelDelete, afInstance, aleChannelUpdate, TeamMembershipState, aleChannelOverwriteDelete, permAllChannel, endpointInteractionsCallback, giDirectMessages, vsfSoundshare, vlLow, matListen, dimscord/constants, aleMessageBulkDelete, permBanMembers, ptTier3, InviteCreate, Integration, TypingStart, ApplicationCommand, VoiceRegion, newOAuth2Application, Member, newVoiceState, DiscordFile, PartialGuild, VoiceState, newGuildChannel, Role, $, GatewaySession, newInviteCreate, RestError, GuildPreview, PermObj, Attachment, InviteMetadata, EmbedProvider, VoiceEvents, newApplicationCommandOption, Events, newDMChannel, newReaction, newAuditLog, Invite, newDiscordClient, Activity, newShard, Ratelimit, User, ActivityStatus, ApplicationCommandInteractionData, UnavailableGuild, keyCheckOptBool, AuditLogChangeValue, GuildChannel, GuildMembersChunk, ApplicationCommandOption, newInvite, keyCheckStr, Ready, newOverwrite, InteractionApplicationCommandCallbackData, newGuildMembersChunk, newInviteMetadata, CacheError, Webhook, AuditLogOptions, keyCheckOptStr, newRole, CacheTablePrefs, Message, MentionChannel, clear, Reaction, Presence, EmbedFooter, EmbedAuthor, CacheTable, newInteraction, newMember, GameAssets, Guild, Overwrite, RestApi, updateMessage, Channel, MessageReference, kind, %%*, EmbedThumbnail, keyCheckOptInt, newTypingStart, newActivity, ApplicationCommandInteractionDataOption, newApplicationCommand, newReady, GuildWidgetJson, newGuildBan, Embed, Shard, OAuth2Application, DMChannel, EmbedImage, EmbedField, GuildBan, InteractionResponse, TeamMember, EmbedVideo, VoiceClient, AuditLog, newWebhook, PartialChannel, Team, newPresence, AllowedMentions, Interaction, newGuild, newUser, dimscord/objects, GatewayBot, Emoji, keyCheckBool, newEmoji, Application, AuditLogEntry, DiscordClient, newApplicationCommandInteractionData, ApplicationCommandOptionChoice, newMessage, defaultAvatarUrl, computePerms, stripMentions, computePerms, permCheck, createBotInvite, stripRoleMentions, stripChannelMentions, event, computePerms, avatarUrl, perms, dimscord/helpers, $, $, @, timestamp, @, @, permCheck, getGuildWidget, iconUrl, stripUserMentions, iconUrl, resume, libsodium_fn, playFFmpeg, disconnect, dimscord/voice, startSession, pause +resume, endSession, updateStatus, dimscord/gateway, disconnect, requestGuildMembers, voiceStateUpdate, updateStatus, latency, startSession, createGuildChannel, getGuildVoiceRegions, deleteMessageReaction, getGuildInvites, getChannelMessages, getGuildIntegrations, getGuildTemplate, getGuildVanityUrl, editApplicationCommand, getGuildChannel, editGuildWidget, getGateway, deleteWebhook, getChannelMessage, getVoiceRegions, removeGuildMember, beginGuildPrune, syncGuildIntegration, deleteGuildRole, editWebhookMessage, editGuildRole, getGuildBan, getGuildWidget, createInteractionResponse, registerApplicationCommand, createChannelInvite, getWebhook, deleteGuildIntegration, getGuildBans, editGuildTemplate, deleteMessageReactionEmoji, createGuildTemplate, getGuildRoles, createGuildFromTemplate, addMessageReaction, getGatewayBot, createGuild, getChannelWebhooks, deleteApplicationCommand, deleteChannel, getChannelInvites, deleteGuild, leaveGuild, getCurrentUser, getApplicationCommands, editGuildIntegration, deleteGuildTemplate, createGuildBan, getGuildAuditLogs, deleteAllMessageReactions, editGuild, deleteGuildEmoji, executeWebhook, createGuildEmoji, getGuild, editGuildChannelPositions, getGuildMember, createWebhook, editGuildChannel, deleteGuildChannelPermission, getGuildPreview, editGuildChannelPermissions, editWebhook, editGuildMember, getMessageReactions, createUserDm, getGuildChannels, addGuildMember, bulkDeleteMessages, editCurrentUser, getChannelPins, createGroupDm, sendMessage, triggerTypingIndicator, addChannelMessagePin, executeSlackWebhook, deleteChannelMessagePin, getGuildWebhooks, getGuildPruneCount, deleteMessage, dimscord/restapi, syncGuildTemplate, getGuildMembers, deleteInvite, getUser, crosspostMessage, editGuildRolePosition, executeGithubWebhook, getInvite, createGuildRole, editMessage, editGuildEmoji, deleteWebhookMessage, getCurrentApplication, removeGuildMemberRole, removeGuildBan, setGuildNick, addGuildMemberRole, irtChannelMessage, aleRoleCreate, endpointGuildRegions, vlNone, msfLottie, ufHouseBrilliance, ufSystem, endpointGuildWidget, permManageNicknames, cdnIcons, tmsAccepted, ufHouseBravery, giGuildIntegrations, permAll, afSync, aleMemberMove, ctGroupDM, permManageGuild, endpointWebhookMessage, giGuilds, atCustom, aleMemberRoleUpdate, aleRoleUpdate, ufVerifiedBot, mtUserGuildBoostTier3, IntegrationExpireBehavior, acotRole, giGuildMessageReactions, giGuildMessages, endpointBulkDeleteMessages, permReadMessageHistory, endpointGuildAuditLogs, aleIntegrationDelete, endpointGuildIntegrationsSync, alcRoles, ptNone, cdnAppAssets, giGuildWebhooks, InteractionType, mtReply, permViewAuditLogs, cdnSplashes, endpointGuildCommands, ctDirect, endpointGuildMembersRole, permManageMessages, ecfMembersWithoutRoles, cdnAvatars, giGuildEmojis, alcBool, endpointGuildChannels, UserFlags, ufHouseBalance, acotInt, aleRoleDelete, mfIsCrosspost, cdnDefaultUserAvatars, cdnAttachments, permSendMessages, permPrioritySpeaker, aleWebhookCreate, matJoinRequest, giDirectMessageReactions, permVoiceMoveMembers, cdnChannelIcons, endpointGuildWebhooks, endpointGuildEmojis, mtUserGuildBoost, endpointGuildPreview, aleWebhookDelete, aleInviteDelete, aleEmojiUpdate, cdnAppIcons, endpointGuildMembersNick, mtGuildDiscoveryDisqualified, WebhookType, permAttachFiles, ufHypesquadEvents, acotUser, mtDefault, afJoinRequest, endpointWebhooks, aleBotAdd, ActivityType, endpointWebhookTokenGithub, permViewChannel, AuditLogChangeType, log, aleChannelCreate, permManageChannels, endpointWebhookTokenSlack, aleChannelOverwriteUpdate, aleIntegrationUpdate, ctGuildText, permEmbedLinks, aleMessagePin, permVoiceMuteMembers, endpointChannelPins, ActivityFlags, aleChannelOverwriteCreate, endpointGuildBans, aleMemberPrune, endpointVoiceRegions, aleMemberBanRemove, mtGuildMemberJoin, alcInt, acotSubCommand, permBanMembers, aleMessageUnpin, permMentionEveryone, aleIntegrationCreate, endpointInvites, ufEarlySupporter, VoiceSpeakingFlags, msfPng, whIncoming, MessageActivityType, irtChannelMessageWithSource, whFollower, alcString, permChangeNickname, ChannelType, permCreateInstantInvite, endpointUsers, permKickMembers, permUseVAD, afPlay, afJoin, vlMedium, vsfPriority, acotStr, ptTier1, irtAcknowledge, mtChannelIconChange, ufPartneredServerOwner, endpointUserChannels, itApplicationCommand, permSendTTSMessage, aleWebhookUpdate, permVoiceStream, mfCrossposted, mtGuildDiscoveryRequalified, mtCall, mnlOnlyMentions, endpointTriggerTyping, atPlaying, aleEmojiCreate, endpointGuildVanity, ufTeamUser, mtChannelNameChange, ctGuildNews, endpointChannelPermissions, giGuildMessageTyping, mtUserGuildBoostTier1, InteractionResponseType, endpointChannelMessagesCrosspost, endpointGuildIntegrations, vlVeryHigh, ufBugHunterLevel1, log, mfSupressEmbeds, aleGuildUpdate, acotBool, permAllVoice, endpointGuildInvites, permManageRoles, mtChannelPinnedMessage, endpointGuildPrune, giGuildVoiceStates, MessageType, atWatching, ptTier2, matJoin, endpointReactions, permVoiceSpeak, irtAckWithSource, cdnDiscoverySplashes, permManageEmojis, giGuildPresences, permViewGuildInsights, matSpectate, ufDiscordEmployee, vsfMicrophone, endpointChannelOverwrites, iebRemoveRole, restBase, aleMemberKick, endpointChannelMessages, itPing, atListening, permUseExternalEmojis, afSpectate, MessageFlags, aleMessageDelete, mtApplicationCommand, endpointGroupRecipient, permAddReactions, endpointGuildTemplates, alcNil, libVer, aleEmojiDelete, VerificationLevel, ctGuildStore, acotChannel, MessageNotificationLevel, endpointGuildMembers, mtUserGuildBoostTier2, iebKick, permAllText, mfaElevated, irtPong, giGuildInvites, endpointWebhookToken, acotSubCommandGroup, mtChannelFollowAdd, endpointGlobalCommands, mnlAllMessages, vlHigh, ecfDisabled, ctGuildVoice, ctGuildParent, ecfAllMembers, permVoiceConnect, ExplicitContentFilter, tmsInvited, aleMemberUpdate, aleMemberBanAdd, AuditLogEntryType, mtRecipientAdd, permManageWebhooks, PermissionFlags, endpointGuildRoles, endpointChannelInvites, libName, aleMemberDisconnect, permAdministrator, PremiumTier, mfaNone, vsfSoundshare, ufBugHunterLevel2, ufNone, endpointChannelWebhooks, cdnBase, giGuildBans, aleInviteCreate, endpointOAuth2Application, cdnTeamIcons, mfUrgent, endpointChannels, libAgent, endpointGuilds, cdnCustomEmojis, permVoiceDeafenMembers, ApplicationCommandOptionType, alcOverwrites, GatewayIntent, ufEarlyVerifiedBotDeveloper, mfSourceMessageDeleted, endpointUserGuilds, MFALevel, aleInviteUpdate, giGuildMembers, mtRecipientRemove, giDirectMessageTyping, aleChannelDelete, afInstance, aleChannelUpdate, TeamMembershipState, aleChannelOverwriteDelete, permAllChannel, endpointInteractionsCallback, msfAPng, giDirectMessages, MessageStickerFormat, vlLow, matListen, dimscord/constants, aleMessageBulkDelete, atStreaming, ptTier3, InviteCreate, Guild, EmbedProvider, ApplicationCommand, VoiceRegion, newOAuth2Application, Member, newVoiceState, DiscordFile, PartialGuild, VoiceState, newGuildChannel, Role, $, GatewaySession, newInviteCreate, RestError, GuildPreview, PermObj, Attachment, InviteMetadata, Sticker, VoiceEvents, newApplicationCommandOption, Events, newDMChannel, newReaction, newAuditLog, Invite, newDiscordClient, Activity, newShard, Ratelimit, User, ActivityStatus, ApplicationCommandInteractionData, UnavailableGuild, GuildTemplate, keyCheckOptBool, AuditLogChangeValue, GuildChannel, GuildMembersChunk, ApplicationCommandOption, newInvite, keyCheckStr, Ready, newOverwrite, InteractionApplicationCommandCallbackData, newGuildMembersChunk, newInviteMetadata, CacheError, Webhook, AuditLogOptions, keyCheckOptStr, newRole, CacheTablePrefs, Message, MentionChannel, TypingStart, clear, Reaction, Presence, EmbedFooter, EmbedAuthor, CacheTable, newInteraction, newMember, GameAssets, Integration, Emoji, RestApi, updateMessage, Channel, MessageReference, kind, %%*, EmbedThumbnail, keyCheckOptInt, newTypingStart, newActivity, ApplicationCommandInteractionDataOption, newApplicationCommand, newReady, GuildWidgetJson, newGuildBan, Embed, Shard, OAuth2Application, DMChannel, EmbedImage, EmbedField, GuildBan, InteractionResponse, TeamMember, EmbedVideo, VoiceClient, AuditLog, newWebhook, PartialChannel, Team, newPresence, AllowedMentions, Interaction, newGuild, newUser, dimscord/objects, GatewayBot, Overwrite, keyCheckBool, newEmoji, Application, AuditLogEntry, DiscordClient, newGuildTemplate, newApplicationCommandInteractionData, ApplicationCommandOptionChoice, newMessage, defaultAvatarUrl, computePerms, stripMentions, computePerms, permCheck, createBotInvite, stripRoleMentions, stripChannelMentions, event, computePerms, avatarUrl, perms, dimscord/helpers, $, $, @, timestamp, @, @, permCheck, getGuildWidget, iconUrl, stripUserMentions, iconUrl, resume, libsodium_fn, playFFmpeg, disconnect, dimscord/voice, startSession, pause
@@ -165,7 +165,7 @@

Exports

diff --git a/docs/dimscord/constants.html b/docs/dimscord/constants.html index 88538ae..ee76b65 100644 --- a/docs/dimscord/constants.html +++ b/docs/dimscord/constants.html @@ -136,6 +136,12 @@

dimscord/constants

title="MessageFlags = enum mfCrossposted, mfIsCrosspost, mfSupressEmbeds, mfSourceMessageDeleted, mfUrgent">MessageFlags +
  • UserFlags
  • dimscord/constants
  • TeamMembershipState
  • +
  • MessageStickerFormat
  • dimscord/constants
  • endpointChannelInvites,string
  • + + - + + +   Source -Edit +Edit @@ -1570,9 +1629,9 @@

    Types

      Source -Edit +Edit @@ -1584,9 +1643,9 @@

    Types

      Source -Edit +Edit @@ -1598,9 +1657,9 @@

    Types

      Source -Edit +Edit @@ -1612,9 +1671,9 @@

    Types

    Used for creating guilds.   Source -Edit +Edit @@ -1628,9 +1687,9 @@

    Types

      Source -Edit +Edit @@ -1643,9 +1702,9 @@

    Types

      Source -Edit +Edit @@ -1664,9 +1723,9 @@

    Types

      Source -Edit +Edit @@ -1679,9 +1738,9 @@

    Types

      Source -Edit +Edit @@ -1694,11 +1753,11 @@

    Types

    -choices reference: Table[choice_name, (Some("..."), None[int])] +   Source -Edit +Edit
    @@ -1710,9 +1769,9 @@

    Types

      Source -Edit +Edit @@ -1728,9 +1787,9 @@

    Types

      Source -Edit +Edit @@ -1742,9 +1801,9 @@

    Types

    options Table[option_name, obj]   Source -Edit +Edit @@ -1758,9 +1817,9 @@

    Types

      Source -Edit +Edit @@ -1772,9 +1831,9 @@

    Types

      Source -Edit +Edit @@ -1788,9 +1847,9 @@

    Types

      Source -Edit +Edit @@ -1806,9 +1865,9 @@

    Types

      Source -Edit +Edit @@ -1822,9 +1881,9 @@

    Types

      Source -Edit +Edit @@ -1841,9 +1900,9 @@

    Types

      Source -Edit +Edit @@ -1857,9 +1916,9 @@

    Types

      Source -Edit +Edit @@ -1875,9 +1934,9 @@

    Types

      Source -Edit +Edit @@ -1889,9 +1948,9 @@

    Types

      Source -Edit +Edit @@ -1906,9 +1965,9 @@

    Types

      Source -Edit +Edit @@ -1925,9 +1984,9 @@

    Types

      Source -Edit +Edit @@ -1941,9 +2000,9 @@

    Types

      Source -Edit +Edit @@ -1956,9 +2015,9 @@

    Types

      Source -Edit +Edit @@ -1979,9 +2038,9 @@

    Types

      Source -Edit +Edit @@ -2010,9 +2069,9 @@

    Types

      Source -Edit +Edit @@ -2027,9 +2086,9 @@

    Types

      Source -Edit +Edit @@ -2043,9 +2102,9 @@

    Types

      Source -Edit +Edit @@ -2061,9 +2120,9 @@

    Types

      Source -Edit +Edit @@ -2075,9 +2134,9 @@

    Types

      Source -Edit +Edit @@ -2090,9 +2149,9 @@

    Types

      Source -Edit +Edit @@ -2156,9 +2215,9 @@

    Types

    For reference

      Source -Edit +Edit @@ -2173,9 +2232,9 @@

    Procs

    Checks for a channel kind. (Shortcut)   Source -Edit +Edit @@ -2184,9 +2243,9 @@

    Procs

    Empties cache.   Source -Edit +Edit @@ -2195,9 +2254,9 @@

    Procs

      Source -Edit +Edit @@ -2264,9 +2323,9 @@

    Procs

      Source -Edit +Edit @@ -2275,9 +2334,9 @@

    Procs

      Source -Edit +Edit @@ -2286,9 +2345,9 @@

    Procs

      Source -Edit +Edit @@ -2297,9 +2356,9 @@

    Procs

      Source -Edit +Edit @@ -2308,9 +2367,9 @@

    Procs

      Source -Edit +Edit @@ -2320,9 +2379,9 @@

    Procs

      Source -Edit +Edit @@ -2332,9 +2391,9 @@

    Procs

      Source -Edit +Edit @@ -2343,9 +2402,9 @@

    Procs

      Source -Edit +Edit @@ -2354,9 +2413,9 @@

    Procs

      Source -Edit +Edit @@ -2365,9 +2424,9 @@

    Procs

      Source -Edit +Edit @@ -2376,9 +2435,9 @@

    Procs

      Source -Edit +Edit @@ -2387,9 +2446,9 @@

    Procs

      Source -Edit +Edit @@ -2398,9 +2457,9 @@

    Procs

      Source -Edit +Edit @@ -2409,9 +2468,9 @@

    Procs

      Source -Edit +Edit @@ -2421,9 +2480,9 @@

    Procs

      Source -Edit +Edit @@ -2432,9 +2491,9 @@

    Procs

      Source -Edit +Edit @@ -2444,9 +2503,9 @@

    Procs

      Source -Edit +Edit @@ -2456,9 +2515,9 @@

    Procs

      Source -Edit +Edit @@ -2468,9 +2527,9 @@

    Procs

      Source -Edit +Edit @@ -2480,9 +2539,9 @@

    Procs

      Source -Edit +Edit @@ -2491,9 +2550,21 @@

    Procs

      Source +Edit + + + +
    proc newGuildTemplate(data: JsonNode): GuildTemplate {...}{.
    +    raises: [KeyError, ValueError, JsonKindError], tags: [].}
    +
    + + +  Source -Edit +Edit
    @@ -2503,9 +2574,9 @@

    Procs

      Source -Edit +Edit @@ -2514,9 +2585,9 @@

    Procs

      Source -Edit +Edit @@ -2526,9 +2597,9 @@

    Procs

      Source -Edit +Edit @@ -2537,9 +2608,9 @@

    Procs

      Source -Edit +Edit @@ -2549,9 +2620,9 @@

    Procs

      Source -Edit +Edit @@ -2624,7 +2695,7 @@

    Macros

    diff --git a/docs/dimscord/objects.idx b/docs/dimscord/objects.idx index ce40bb8..7065602 100644 --- a/docs/dimscord/objects.idx +++ b/docs/dimscord/objects.idx @@ -25,6 +25,7 @@ Attachment dimscord/objects.html#Attachment objects: Attachment Reaction dimscord/objects.html#Reaction objects: Reaction Emoji dimscord/objects.html#Emoji objects: Emoji Application dimscord/objects.html#Application objects: Application +Sticker dimscord/objects.html#Sticker objects: Sticker RestApi dimscord/objects.html#RestApi objects: RestApi Ratelimit dimscord/objects.html#Ratelimit objects: Ratelimit UnavailableGuild dimscord/objects.html#UnavailableGuild objects: UnavailableGuild @@ -37,6 +38,7 @@ Presence dimscord/objects.html#Presence objects: Presence Guild dimscord/objects.html#Guild objects: Guild VoiceState dimscord/objects.html#VoiceState objects: VoiceState Role dimscord/objects.html#Role objects: Role +GuildTemplate dimscord/objects.html#GuildTemplate objects: GuildTemplate ActivityStatus dimscord/objects.html#ActivityStatus objects: ActivityStatus Overwrite dimscord/objects.html#Overwrite objects: Overwrite PermObj dimscord/objects.html#PermObj objects: PermObj @@ -106,6 +108,7 @@ newMessage dimscord/objects.html#newMessage,JsonNode objects: newMessage(data: J newAuditLog dimscord/objects.html#newAuditLog,JsonNode objects: newAuditLog(data: JsonNode): AuditLog newOAuth2Application dimscord/objects.html#newOAuth2Application,JsonNode objects: newOAuth2Application(data: JsonNode): OAuth2Application newGuild dimscord/objects.html#newGuild,JsonNode objects: newGuild(data: JsonNode): Guild +newGuildTemplate dimscord/objects.html#newGuildTemplate,JsonNode objects: newGuildTemplate(data: JsonNode): GuildTemplate newApplicationCommandInteractionData dimscord/objects.html#newApplicationCommandInteractionData,JsonNode objects: newApplicationCommandInteractionData(data: JsonNode): ApplicationCommandInteractionData newInteraction dimscord/objects.html#newInteraction,JsonNode objects: newInteraction(data: JsonNode): Interaction newApplicationCommandOption dimscord/objects.html#newApplicationCommandOption,JsonNode objects: newApplicationCommandOption(data: JsonNode): ApplicationCommandOption diff --git a/docs/dimscord/restapi.html b/docs/dimscord/restapi.html index 7d2f630..bacffb0 100644 --- a/docs/dimscord/restapi.html +++ b/docs/dimscord/restapi.html @@ -255,6 +255,11 @@

    dimscord/restapi

  • deleteInvite,RestApi,string,string
  • + + + + + + + +   Source -Edit +Edit @@ -775,9 +826,9 @@

    Procs

    Deletes the user's or the bot's message reaction to a Discord message.   Source -Edit +Edit @@ -789,9 +840,9 @@

    Procs

    Deletes all the reactions for emoji.   Source -Edit +Edit @@ -803,9 +854,9 @@

    Procs

    Get all user message reactions on the emoji provided.   Source -Edit +Edit @@ -816,9 +867,9 @@

    Procs

    Remove all message reactions.   Source -Edit +Edit @@ -836,9 +887,9 @@

    Procs

      Source -Edit +Edit @@ -850,13 +901,15 @@

    Procs

    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    -

    Modifies the webhook message. You can actually use this to modify original interaction or followup message.

    -

    webhook_id can also be application_id webhook_token can also be interaction token. message_id can be @original

    +Modifies the webhook message. You can actually use this to modify original interaction or followup message.   Source -Edit +Edit
    @@ -866,13 +919,14 @@

    Procs

    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    -

    Modifies the webhook message. You can actually use this to delete original interaction or followup message.

    -

    webhook_id can also be application_id webhook_token can also be interaction token.

    +Modifies the webhook message. You can actually use this to delete original interaction or followup message.   Source -Edit +Edit
    @@ -883,9 +937,9 @@

    Procs

    Executes a slack webhook. If wait is false make sure to discard await it.   Source -Edit +Edit @@ -896,9 +950,9 @@

    Procs

    Executes a github webhook. If wait is false make sure to discard await it.   Source -Edit +Edit @@ -1543,17 +1597,16 @@

    Procs

    -
    proc getGuildWidget(api: RestApi; guild_id: string): Future[
    -    tuple[enabled: bool, channel_id: Option[string]]] {...}{.
    +
    proc getGuildWidget(api: RestApi; guild_id: string): Future[GuildWidgetJson] {...}{.
         raises: [Exception, ValueError],
         tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    Gets a guild widget.   Source -Edit +Edit
    @@ -1566,9 +1619,9 @@

    Procs

    Modifies a guild widget.   Source -Edit +Edit @@ -1579,9 +1632,9 @@

    Procs

    Gets guild preview.   Source -Edit +Edit @@ -1594,9 +1647,9 @@

    Procs

    Adds a guild member. If member is in the guild, then exists will be true.   Source -Edit +Edit @@ -1608,9 +1661,9 @@

    Procs

    Creates a guild emoji. The image needs to be a base64 string. (See: https://nim-lang.org/docs/base64.html)   Source -Edit +Edit @@ -1622,9 +1675,9 @@

    Procs

    Modifies a guild emoji.   Source -Edit +Edit @@ -1635,9 +1688,9 @@

    Procs

    Deletes a guild emoji.   Source -Edit +Edit @@ -1648,9 +1701,9 @@

    Procs

    Gets a guild's voice regions.   Source -Edit +Edit @@ -1661,9 +1714,89 @@

    Procs

    Get voice regions   Source +Edit + + + +
    proc createGuildFromTemplate(api: RestApi; code: string): Future[Guild] {...}{.
    +    raises: [Exception, ValueError],
    +    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    +
    + +Create a guild from a template, this endpoint is used for bots that are in >10 guilds +  Source +Edit + +
    + +
    proc getGuildTemplate(api: RestApi; code: string): Future[GuildTemplate] {...}{.
    +    raises: [Exception, ValueError],
    +    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    +
    + +Get guild template from its code. +  Source +Edit + +
    + +
    proc createGuildTemplate(api: RestApi; guild_id, name: string;
    +                         description = none string): Future[GuildTemplate] {...}{.
    +    raises: [Exception, ValueError],
    +    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    +
    + +Create a guild template +  Source +Edit + +
    + +
    proc syncGuildTemplate(api: RestApi; guild_id, code: string): Future[
    +    GuildTemplate] {...}{.raises: [Exception, ValueError], tags: [RootEffect,
    +    TimeEffect, ReadIOEffect, WriteIOEffect].}
    +
    + +Sync guild template. +  Source +Edit + +
    + +
    proc editGuildTemplate(api: RestApi; guild_id, code: string;
    +                       name, description = none string): Future[GuildTemplate] {...}{.
    +    raises: [Exception, ValueError],
    +    tags: [RootEffect, TimeEffect, ReadIOEffect, WriteIOEffect].}
    +
    + +Modify a guild template. +  Source +Edit + +
    + +
    proc deleteGuildTemplate(api: RestApi; guild_id, code: string): Future[
    +    GuildTemplate] {...}{.raises: [Exception, ValueError], tags: [RootEffect,
    +    TimeEffect, ReadIOEffect, WriteIOEffect].}
    +
    + +Delete guild template. +  Source -Edit +Edit
    @@ -1942,7 +2075,7 @@

    Procs

    diff --git a/docs/dimscord/restapi/requester.html b/docs/dimscord/restapi/requester.html index 33cbab1..788f91d 100644 --- a/docs/dimscord/restapi/requester.html +++ b/docs/dimscord/restapi/requester.html @@ -164,9 +164,9 @@

    Procs

      Source -Edit +Edit @@ -175,9 +175,9 @@

    Procs

      Source -Edit +Edit @@ -191,9 +191,9 @@

    Macros

      Source -Edit +Edit @@ -202,9 +202,9 @@

    Macros

      Source -Edit +Edit @@ -213,9 +213,9 @@

    Macros

      Source -Edit +Edit @@ -228,7 +228,7 @@

    Macros

    diff --git a/docs/dimscord/restapi/user.html b/docs/dimscord/restapi/user.html index caa1964..6bd34af 100644 --- a/docs/dimscord/restapi/user.html +++ b/docs/dimscord/restapi/user.html @@ -505,7 +505,7 @@

    Procs

    diff --git a/docs/dimscord/voice.html b/docs/dimscord/voice.html index e8a7830..ed288bc 100644 --- a/docs/dimscord/voice.html +++ b/docs/dimscord/voice.html @@ -239,7 +239,7 @@

    Procs

    diff --git a/docs/theindex.html b/docs/theindex.html index 4d583e1..11af1b3 100644 --- a/docs/theindex.html +++ b/docs/theindex.html @@ -596,6 +596,10 @@

    Index

    roles: seq[string] = @[]; reason = ""): Future[Emoji]" href="dimscord/restapi.html#createGuildEmoji%2CRestApi%2Cstring%2Cstring%2Cstring%2Cseq%5Bstring%5D%2Cstring">restapi: createGuildEmoji(api: RestApi; guild_id, name, image: string; roles: seq[string] = @[]; reason = ""): Future[Emoji] +
    createGuildFromTemplate:
    createGuildRole:
    +
    createGuildTemplate:
    createInteractionResponse:
    +
    crosspostMessage:
    ctDirect:
    +
    deleteGuildTemplate:
    deleteInvite:
    +
    editGuildTemplate:
    editGuildWidget:
    +
    endpointChannelMessagesCrosspost:
    endpointChannelOverwrites:
    +
    endpointGuildTemplates:
    endpointGuildVanity:
    +
    getGuildTemplate:
    getGuildVanityUrl:
    getInvite:
    +
    GuildTemplate:
    GuildWidgetJson:
    +
    MessageStickerFormat:
    MessageType:
    +
    msfAPng:
    +
    msfLottie:
    +
    msfPng:
    mtApplicationCommand:
    +
    newGuildTemplate:
    newInteraction:
    • objects: newInteraction(data: JsonNode): Interaction
    • @@ -2151,10 +2209,12 @@

      Index

      data-doc-search-tag="restapi: sendMessage(api: RestApi; channel_id: string; content = ""; tts = false; embed = none Embed; allowed_mentions = none AllowedMentions; nonce: Option[string] or Option[int] = none(int); - files = none seq[DiscordFile]): Future[Message]" href="dimscord/restapi.html#sendMessage%2CRestApi%2Cstring%2Cstring">restapi: sendMessage(api: RestApi; channel_id: string; content = ""; tts = false; + files = none seq[DiscordFile]; + message_reference = none MessageReference): Future[Message]" href="dimscord/restapi.html#sendMessage%2CRestApi%2Cstring%2Cstring">restapi: sendMessage(api: RestApi; channel_id: string; content = ""; tts = false; embed = none Embed; allowed_mentions = none AllowedMentions; nonce: Option[string] or Option[int] = none(int); - files = none seq[DiscordFile]): Future[Message] + files = none seq[DiscordFile]; + message_reference = none MessageReference): Future[Message]
    setGuildNick:
    +
    Sticker:
    stripChannelMentions:
    • helpers: stripChannelMentions(m: Message): string
    • @@ -2210,6 +2274,10 @@

      Index

      Future[void])" href="dimscord/restapi.html#syncGuildIntegration%2CRestApi%2Cstring%2Cstring">restapi: syncGuildIntegration(api: RestApi; guild_id, integ_id: string): owned( Future[void])
    +
    syncGuildTemplate:
    Team:
    +
    ufBugHunterLevel1:
    +
    ufBugHunterLevel2:
    +
    ufDiscordEmployee:
    +
    ufEarlySupporter:
    +
    ufEarlyVerifiedBotDeveloper:
    +
    ufHouseBalance:
    +
    ufHouseBravery:
    +
    ufHouseBrilliance:
    +
    ufHypesquadEvents:
    +
    ufNone:
    +
    ufPartneredServerOwner:
    +
    ufSystem:
    +
    ufTeamUser:
    +
    ufVerifiedBot:
    UnavailableGuild:
    +
    UserFlags:
    VerificationLevel:
    • constants: VerificationLevel
    • @@ -2347,7 +2475,7 @@

      Index