Module discordnim

Search:
Group by:

Types

Overwrite* = object
  id*: string
  `type`*: string
  allow*: int
  deny*: int
  Source Edit
DChannel* = object of RootObj
  id*: string
  guild_id*: string
  name*: string
  `type`*: int
  position*: int
  is_private*: bool
  permission_overwrites*: seq[Overwrite]
  topic*: string
  last_message_id*: string
  bitrate*: int
  user_limit*: int
  recipients*: seq[User]
  Source Edit
Message* = object of RootObj
  `type`: int
  tts*: bool
  timestamp*: string
  pinned*: bool
  nonce*: string
  mention_roles*: seq[Role]
  mentions*: seq[User]
  mention_everyone*: bool
  id*: string
  embeds*: seq[Embed]
  edited_timestamp*: string
  content*: string
  channel_id*: string
  author*: User
  attachments*: seq[Attachment]
  reactions*: seq[Reaction]
  webhook_id*: string
  Source Edit
Reaction* = object
  count*: int
  me*: bool
  emoji*: Emoji
  Source Edit
Emoji* = object
  id*: string
  name*: string
  roles*: seq[Role]
  require_colons*: bool
  managed*: bool
  Source Edit
Embed* = ref object
  title*: string
  `type`*: string
  description*: string
  url*: string
  timestamp*: string
  color*: int
  footer*: Footer
  image*: Image
  thumbnail*: Thumbnail
  video*: Video
  provider*: Provider
  author*: Author
  fields*: seq[Field]
  Source Edit
Thumbnail* = ref object
  url*: string
  proxy_url*: string
  height*: int
  width*: int
  Source Edit
Video* = ref object
  url*: string
  height*: int
  width*: int
  Source Edit
Image* = ref object
  url*: string
  proxy_url*: string
  height*: int
  width*: int
  Source Edit
Provider* = ref object
  name*: string
  url*: string
  Source Edit
Author* = ref object
  name*: string
  url*: string
  icon_url*: string
  proxy_icon_url*: string
  Source Edit
  Source Edit
Field* = ref object
  name*: string
  value*: string
  inline*: bool
  Source Edit
Attachment* = object
  id*: string
  filename*: string
  size*: int
  url*: string
  proxy_url*: string
  height*: int
  width*: int
  Source Edit
Presence* = object
  user: User
  status: string
  game: Game
  nick: string
  roles: seq[string]
  Source Edit
Guild* = object of RootObj
  id*: string
  name*: string
  icon*: string
  splash*: string
  owner_id*: string
  region*: string
  afk_channel_id*: string
  afk_timeout*: int
  embed_enabled*: bool
  embed_channel_id*: string
  verification_level*: int
  default_message_notifications*: int
  roles*: seq[Role]
  emojis*: seq[Emoji]
  mfa_level*: int
  joined_at*: string
  large*: bool
  unavailable*: bool
  features: seq[JsonNode]
  explicit_content_filter*: int
  member_count*: int
  voice_states*: seq[VoiceState]
  members*: seq[GuildMember]
  channels*: seq[DChannel]
  presences*: seq[Presence]
  application_id*: string
  Source Edit
GuildMember* = object of RootObj
  guild_id*: string
  user*: User
  nick*: string
  roles*: seq[string]
  joined_at*: string
  deaf*: bool
  mute*: bool
  Source Edit
Integration* = object
  id*: string
  name*: string
  `type`*: string
  enabled*: bool
  syncing*: bool
  role_id*: string
  expire_behavior*: int
  expire_grace_period*: int
  user*: User
  account*: Account
  synced_at*: string
  Source Edit
Account* = object
  id*: string
  name*: string
  Source Edit
Invite* = object
  code*: string
  guild*: InviteGuild
  channel*: InviteChannel
  Source Edit
InviteMetadata* = object
  inviter*: User
  uses*: int
  max_uses*: int
  max_age*: int
  temporary*: bool
  created_at*: string
  revoked*: bool
  Source Edit
InviteGuild* = object
  id*: string
  name*: string
  splash*: string
  icon*: string
  Source Edit
InviteChannel* = object
  id*: string
  name*: string
  `type`*: string
  Source Edit
User* = object of RootObj
  id*: string
  username*: string
  discriminator*: string
  avatar*: string
  bot*: bool
  mfa_enabled*: bool
  verified*: bool
  email*: string
  Source Edit
UserGuild* = object
  id: string
  name: string
  icon: string
  owner: bool
  permissions: int
  Source Edit
Connection* = object
  id*: string
  name*: string
  `type`*: string
  revoked*: bool
  integrations*: seq[Integration]
  Source Edit
VoiceState* = object of RootObj
  guild_id*: string
  channel_id*: string
  user_id*: string
  session_id*: string
  deaf*: bool
  mute*: bool
  self_deaf*: bool
  self_mute*: bool
  suppress*: bool
  Source Edit
VoiceRegion* = object
  id*: string
  name*: string
  sample_hostname*: string
  sample_port*: int
  vip*: bool
  optimal*: bool
  deprecated*: bool
  custom*: bool
  Source Edit
Webhook* = object
  id*: string
  guild_id*: string
  channel_id*: string
  user*: User
  name*: string
  avatar*: string
  token*: string
  Source Edit
Role* = object
  id*: string
  name*: string
  color*: int
  hoist*: bool
  position*: int
  permissions*: int
  managed*: bool
  mentionable*: bool
  Source Edit
ChannelParams* = ref object
  name*: string
  position*: int
  topic*: string
  bitrate*: int
  user_limit*: int
  Source Edit
GuildParams* = ref object
  name*: string
  region*: string
  verification_level*: int
  default_message_notifications*: int
  afk_channel_id*: string
  afk_timeout*: int
  icon*: string
  owner_id*: string
  splash*: string
  Source Edit
GuildMemberParams* = ref object
  nick*: string
  roles*: seq[string]
  mute*: bool
  deaf*: bool
  channel_id*: string
  Source Edit
GuildEmbed* = object
  enabled*: bool
  channel_id*: string
  Source Edit
WebhookParams* = ref object
  content*: string
  username*: string
  avatar_url*: string
  tts*: bool
  embeds*: Embed
  Source Edit
GuildDelete* = object
  id*: string
  unavailable*: bool
  Source Edit
GuildEmojisUpdate* = object
  guild_id*: string
  emojis*: seq[Emoji]
  Source Edit
GuildIntegrationsUpdate* = object
  guild_id*: string
  Source Edit
GuildRoleCreate* = object
  guild_id*: string
  role*: Role
  Source Edit
GuildRoleUpdate* = object
  guild_id*: string
  role*: Role
  Source Edit
GuildRoleDelete* = object
  guild_id*: string
  role_id*: string
  Source Edit
MessageDeleteBulk* = object
  ids*: seq[string]
  channel_id*: string
  Source Edit
Game* = ref object
  name*: string
  `type`*: int
  url*: string
  Source Edit
PresenceUpdate* = object
  user*: User
  roles*: seq[string]
  game*: Game
  guild_id*: string
  status*: string
  Source Edit
TypingStart* = object
  channel_id*: string
  user_id*: string
  timestamp*: int
  Source Edit
VoiceServerUpdate* = object
  token: string
  guild_id: string
  endpoint: string
  Source Edit
Resumed* = object
  trace*: seq[string]
  Source Edit
Cache* = ref object
  version*: int
  me*: User
  cacheChannels*: bool
  cacheGuilds*: bool
  cacheGuildMembers*: bool
  cacheUsers*: bool
  cacheRoles*: bool
  channels: Table[string, DChannel]
  guilds: Table[string, Guild]
  users: Table[string, User]
  roles: Table[string, Role]
  Source Edit
Ready* = object
  v*: int
  user*: User
  private_channels*: seq[DChannel]
  session_id*: string
  guilds*: seq[Guild]
  trace*: seq[string]
  user_settings: JsonNode
  relationships: JsonNode
  presences: seq[Presence]
  Source Edit
MessageCreate* = object of Message
  Source Edit
MessageUpdate* = object of Message
  Source Edit
MessageDelete* = object
  id*: string
  channel_id*: string
  Source Edit
GuildMemberAdd* = object of GuildMember
  Source Edit
GuildMemberUpdate* = object of GuildMember
  Source Edit
GuildMemberRemove* = object of GuildMember
  Source Edit
GuildMembersChunk* = object
  guild_id: string
  query: string
  limit: int
  Source Edit
GuildCreate* = object of Guild
  Source Edit
GuildUpdate* = object of Guild
  Source Edit
GuildBanAdd* = object of User
  Source Edit
GuildBanRemove* = object of User
  Source Edit
ChannelCreate* = object of DChannel
  Source Edit
ChannelUpdate* = object of DChannel
  Source Edit
ChannelDelete* = object of DChannel
  Source Edit
UserUpdate* = object of User
  Source Edit
VoiceStateUpdate* = object of VoiceState
  Source Edit
MessageReactionAdd* = object
  user_id: string
  message_id: string
  channel_id: string
  emoji: Emoji
  Source Edit
MessageReactionRemove* = object
  user_id: string
  message_id: string
  channel_id: string
  emoji: Emoji
  Source Edit
MessageReactionRemoveAll* = object
  message_id: string
  channel_id: string
  Source Edit
Session* = ref SessionImpl
  Source Edit
CacheError* = object of Exception
  Source Edit
AddGroupDMUser* = object
  id: string
  nick: string
  Source Edit
IdentifyError* = object of Exception
  Source Edit

Consts

OP_DISPATCH* = 0
  Source Edit
OP_HEARTBEAT* = 1
  Source Edit
OP_IDENTIFY* = 2
  Source Edit
OP_STATUS_UPDATE* = 3
  Source Edit
OP_VOICE_STATE_UPDATE* = 4
  Source Edit
OP_VOICE_SERVER_PING* = 5
  Source Edit
OP_RESUME* = 6
  Source Edit
OP_RECONNECT* = 7
  Source Edit
OP_REQUEST_GUILD_MEMBERS* = 8
  Source Edit
OP_INVALID_SESSION* = 9
  Source Edit
OP_HELLO* = 10
  Source Edit
OP_HEARTBEAT_ACK* = 11
  Source Edit
CREATE_INSTANT_INVITE* = 0x00000001
  Source Edit
KICK_MEMBERS* = 0x00000002
  Source Edit
BAN_MEMBERS* = 0x00000004
  Source Edit
ADMINISTRATOR* = 0x00000008
  Source Edit
MANAGE_CHANNELS* = 0x00000010
  Source Edit
MANAGE_GUILD* = 0x00000020
  Source Edit
ADD_REACTIONS* = 0x00000040
  Source Edit
READ_MESSAGES* = 0x00000400
  Source Edit
SEND_MESSAGES* = 0x00000800
  Source Edit
SEND_TTS_MESSAGES* = 0x00001000
  Source Edit
MANAGE_MESSAGES* = 0x00002000
  Source Edit
  Source Edit
ATTACH_FILES* = 0x00008000
  Source Edit
READ_MESSAGE_HISTORY* = 0x00010000
  Source Edit
MENTION_EVERYONE* = 0x00020000
  Source Edit
USE_EXTERNAL_EMOJIS* = 0x00040000
  Source Edit
CONNECT* = 0x00100000
  Source Edit
SPEAK* = 0x00200000
  Source Edit
MUTE_MEMBERS* = 0x00400000
  Source Edit
DEAFEN_MEMBERS* = 0x00800000
  Source Edit
MOVE_MEMBERS* = 0x01000000
  Source Edit
USE_VAD* = 0x02000000
  Source Edit
CHANGE_NICKNAME* = 0x04000000
  Source Edit
MANAGE_NICKNAMES* = 0x08000000
  Source Edit
MANAGE_ROLES* = 0x10000000
  Source Edit
MANAGE_WEBHOOKS* = 0x20000000
  Source Edit
MANAGE_EMOJIS* = 0x40000000
  Source Edit

Procs

proc NewSession*(args: varargs[string, `$`]): Session
Creates a new Session   Source Edit
proc getGuild*(c: Cache; id: string): tuple[guild: Guild, exists: bool]
  Source Edit
proc removeGuild*(c: Cache; guildid: string) {.
raises: CacheError
.}
  Source Edit
proc updateGuild*(c: Cache; guild: Guild) {.
raises: CacheError
.}
  Source Edit
proc getUser*(c: Cache; id: string): tuple[user: User, exists: bool]
  Source Edit
proc removeUser*(c: Cache; id: string) {.
raises: CacheError
.}
  Source Edit
proc updateUser*(c: Cache; user: User) {.
raises: CacheError
.}
  Source Edit
proc getChannel*(c: Cache; id: string): tuple[channel: DChannel, exists: bool]
  Source Edit
proc updateChannel*(c: Cache; chan: DChannel) {.
raises: CacheError
.}
  Source Edit
proc removeChannel*(c: Cache; chan: string) {.
raises: CacheError
.}
  Source Edit
proc getGuildMember*(c: Cache; guild, memberid: string): tuple[member: GuildMember,
    exists: bool]
  Source Edit
proc addGuildMember*(c: Cache; member: GuildMember)
  Source Edit
proc updateGuildMember*(c: Cache; m: GuildMember)
  Source Edit
proc removeGuildMember*(c: Cache; gmember: GuildMember)
  Source Edit
proc getRole*(c: Cache; guildid, roleid: string): tuple[role: Role, exists: bool]
  Source Edit
proc updateRole*(c: Cache; role: Role) {.
raises: CacheError
.}
  Source Edit
proc removeRole*(c: Cache; role: string) {.
raises: CacheError
.}
  Source Edit
proc SessionStart*(s: Session) {.
async, gcsafe
.}
Starts a Session   Source Edit
proc `$`*(u: User): string {.
gcsafe, inline
.}

Stringifies a user.

e.g: Username#1234

  Source Edit
proc `$`*(c: DChannel): string {.
gcsafe, inline
.}

Stringifies a channel.

e.g: #channel-name

  Source Edit
proc `$`*(e: Emoji): string {.
gcsafe, inline
.}

Stringifies an emoji.

e.g: :emojiName:129837192873

  Source Edit
proc `@`*(u: User): string {.
gcsafe, inline
.}

Returns a message formatted user mention.

e.g: <@109283102983019283>

  Source Edit
proc `@`*(c: DChannel): string {.
gcsafe, inline
.}

Returns a message formatted channel mention.

e.g: <#1239810283>

  Source Edit
proc `@`*(r: Role): string {.
gcsafe, inline
.}

Returns a message formatted role mention

e.g: <@&129837128937>

  Source Edit
proc `@`*(e: Emoji): string {.
gcsafe, inline
.}

Returns a message formated emoji.

e.g: <:emojiName:1920381>

  Source Edit
proc StripMentions*(msg: Message): string {.
gcsafe
.}

Strips all user mentions from a message and replaces them with plaintext

e.g: <@1901092738173> -> @Username#1234

  Source Edit
proc StripEveryoneMention*(msg: Message): string {.
gcsafe
.}
Strips a message of any @everyone and @here mention   Source Edit
proc newMessageEmbed*(title, description, url: string = ""; color: int = 0;
                     footer: Footer = nil; image: Image = nil; thumb: Thumbnail = nil;
                     video: Video = nil; provider: Provider = nil; author: Author = nil;
                     fields: seq[Field] = nil): Embed {.
gcsafe
.}
Initialises a new Embed object   Source Edit
proc newChannelParams*(name, topic: string = ""; position: int = 0; bitrate: int = 48;
                      userlimit: int = 0): ChannelParams {.
gcsafe
.}
Initialises a new ChannelParams object for altering channel settings.   Source Edit
proc newGuildParams*(name, region, afkchan: string = ""; verlvl: int = 0;
                    defnotif: int = 0; afktim: int = 0; icon: string = "";
                    ownerid: string = ""; splash: string = ""): GuildParams {.
gcsafe
.}
Initialises a new GuildParams object for altering guild settings.   Source Edit
proc newGuildMemberParams*(nick, channelid: string = ""; roles: seq[string] = @ [];
                          mute: bool = false; deaf: bool = false): GuildMemberParams {.
gcsafe
.}
Initialises a new GuildMemberParams object for altering guild members.   Source Edit
proc newWebhookParams*(content, username, avatarurl: string = ""; tts: bool = false;
                      embeds: Embed = nil): WebhookParams {.
gcsafe
.}
Initialises a new WebhookParams object for altering webhooks.   Source Edit
proc messageGuild*(s: Session; m: Message): string

Returns the guild id of the guild the message was sent in.

Returns an empty string if it can't find the guild in the cache or by requesting it from the API.

  Source Edit

Methods

method GetChannel*(s: Session; channel_id: string): DChannel {.
base, gcsafe
.}
Returns the channel with the given ID   Source Edit
method ModifyChannel*(s: Session; channelid: string; params: ChannelParams): Guild {.
base, gcsafe
.}
Modifies a channel with the ChannelParams   Source Edit
method DeleteChannel*(s: Session; channelid: string): DChannel {.
base, gcsafe
.}
Deletes a channel   Source Edit
method ChannelMessages*(s: Session; channelid: string; before, after, around: string;
                       limit: int): seq[Message] {.
base, gcsafe
.}
Returns a channels messages Maximum of 100 messages   Source Edit
method ChannelMessage*(s: Session; channelid, messageid: string): Message {.
base, gcsafe
.}
Returns a message from a channel   Source Edit
method SendMessage*(s: Session; channelid, message: string): Message {.
base, gcsafe
.}
Sends a regular text message to a channel   Source Edit
method SendMessageEmbed*(s: Session; channelid: string; embed: Embed): Message {.
base, gcsafe
.}
Sends an Embed message to a channel   Source Edit
method SendMessageTTS*(s: Session; channelid, message: string): Message {.
base, gcsafe
.}
Sends a TTS message to a channel   Source Edit
method SendFileWithMessage*(s: Session; channelid, name, message: string): Message {.
base, gcsafe
.}
Sends a file to a channel along with a message   Source Edit
method SendFile*(s: Session; channelid, name: string): Message {.
base, gcsafe
.}
Sends a file to a channel   Source Edit
method MessageAddReaction*(s: Session; channelid, messageid, emojiid: string) {.
base, gcsafe
.}
Adds a reaction to a message   Source Edit
method MessageDeleteOwnReaction*(s: Session; channelid, messageid, emojiid: string) {.
base, gcsafe
.}
Deletes your own reaction to a message   Source Edit
method MessageDeleteReaction*(s: Session;
                             channelid, messageid, emojiid, userid: string) {.
base, gcsafe
.}
Deletes a reaction from a user from a message   Source Edit
method MessageGetReactions*(s: Session; channelid, messageid, emojiid: string): seq[
    User] {.
base, gcsafe
.}
Gets a message's reactions   Source Edit
method MessageDeleteAllReactions*(s: Session; channelid, messageid: string) {.
base, gcsafe
.}
Deletes all reactions on a message   Source Edit
method EditMessage*(s: Session; channelid, messageid, content: string): Message {.
base, gcsafe
.}
Edits a message's contents   Source Edit
method DeleteMessage*(s: Session; channelid, messageid: string) {.
base, gcsafe
.}
Deletes a message   Source Edit
method BulkDeleteMessages*(s: Session; channelid: string; messages: seq[string]) {.
base, gcsafe
.}
Deletes messages in bulk Will not delete messages older than 2 weeks   Source Edit
method EditChannelPermissions*(s: Session; channelid: string; overwrite: Overwrite) {.
base, gcsafe
.}
Edits a channel's permissions   Source Edit
method ChannelInvites*(s: Session; channel: string): seq[Invite] {.
base, gcsafe
.}
Returns all invites to a channel   Source Edit
method CreateChannelInvite*(s: Session; channel: string; max_age, max_uses: int;
                           temp, unique: bool): Invite {.
base, gcsafe
.}
Creates an invite to a channel   Source Edit
method DeleteChannelPermission*(s: Session; channel, target: string) {.
base, gcsafe
.}
Deletes a channel permission   Source Edit
method TriggerTypingIndicator*(s: Session; channel: string) {.
base, gcsafe
.}
Triggers the "X is typing" indicator   Source Edit
method ChannelPinnedMessages*(s: Session; channel: string): seq[Message] {.
base, gcsafe
.}
Returns all pinned messages in a channel   Source Edit
method ChannelPinMessage*(s: Session; channel, message: string) {.
base, gcsafe
.}
Pins a message in a channel   Source Edit
method ChannelDeletePinnedMessage*(s: Session; channel, message: string) {.
base, gcsafe
.}
  Source Edit
method CreateGroupDM*(s: Session; accesstokens: seq[string];
                     nicks: seq[AddGroupDMUser]): DChannel {.
base, gcsafe
.}
Creates a group DM channel   Source Edit
method GroupDMAddUser*(s: Session; channelid, userid, access_token, nick: string) {.
base, gcsafe
.}
Adds a user to a group dm. Requires the 'gdm.join' scope.   Source Edit
method GroupdDMRemoveUser*(s: Session; channelid, userid: string) {.
base, gcsafe
.}
Removes a user from a group dm.   Source Edit
method CreateGuild*(s: Session; name: string): Guild {.
base, gcsafe
.}
Creates a guild This endpoint is limited to 10 active guilds   Source Edit
method GetGuild*(s: Session; id: string): Guild {.
base, gcsafe
.}
Gets a guild   Source Edit
method ModifyGuild*(s: Session; guild: string; settings: GuildParams): Guild {.
base, gcsafe
.}
Modifies a guild with the GuildParams   Source Edit
method DeleteGuild*(s: Session; guild: string): Guild {.
base, gcsafe
.}
Deletes a guild   Source Edit
method GuildChannels*(s: Session; guild: string): seq[DChannel] {.
base, gcsafe
.}
Returns all guild channels   Source Edit
method GuildChannelCreate*(s: Session; guild, channelname: string; voice: bool): DChannel {.
base, gcsafe
.}
Creates a new channel in a guild   Source Edit
method ModifyGuildChannelPosition*(s: Session; guild, channel: string; position: int): seq[
    DChannel] {.
base, gcsafe
.}
Reorders the position of a channel and returns the new order   Source Edit
method GuildMembers*(s: Session; guild: string; limit, after: int): seq[GuildMember] {.
base, gcsafe
.}
Returns up to 1000 guild members   Source Edit
method GetGuildMember*(s: Session; guild, userid: string): GuildMember {.
base, gcsafe
.}
Returns a guild member with the userid   Source Edit
method GuildAddMember*(s: Session; guild, userid, accesstoken: string): GuildMember {.
base, gcsafe
.}
Adds a guild member to the guild   Source Edit
method GuildMemberRoles*(s: Session; guild, userid: string; roles: seq[string]) {.
base, gcsafe
.}
Modifies a guild member's roles   Source Edit
method GuildMemberNick*(s: Session; guild, userid, nick: string) {.
base, gcsafe
.}
Sets the nickname of a member   Source Edit
method GuildMemberMute*(s: Session; guild, userid: string; mute: bool) {.
base, gcsafe
.}
Mutes a guild member   Source Edit
method GuildMemberDeafen*(s: Session; guild, userid: string; deafen: bool) {.
base, gcsafe
.}
Deafens a guild member   Source Edit
method GuildMemberMove*(s: Session; guild, userid, channel: string) {.
base, gcsafe
.}
Moves a guild member from one channel to another only works if they are connected to a voice channel   Source Edit
method Nick*(s: Session; guild, nick: string) {.
base, gcsafe
.}
Sets the nick for the current user   Source Edit
method GuildMemberAddRole*(s: Session; guild, userid, roleid: string) {.
base, gcsafe
.}
Adds a role to a guild member   Source Edit
method GuildMemberRemoveRole*(s: Session; guild, userid, roleid: string) {.
base, gcsafe
.}
Removes a role from a guild member   Source Edit
method GuildRemoveMember*(s: Session; guild, userid: string) {.
base, gcsafe
.}
Removes a guild membe from the guild   Source Edit
method GuildBans*(s: Session; guild: string): seq[User] {.
base, gcsafe
.}
Returns all users who have been banned from the guild   Source Edit
method GuildBanUser*(s: Session; guild, userid: string) {.
base, gcsafe
.}
Bans a user from the guild   Source Edit
method GuildRemoveBan*(s: Session; guild, userid: string) {.
base, gcsafe
.}
Removes a ban from the guild   Source Edit
method GuildRoles*(s: Session; guild: string): seq[Role] {.
base, gcsafe
.}
Returns all guild roles   Source Edit
method GuildRole*(s: Session; guild, roleid: string): Role {.
base, gcsafe
.}
Returns a role with the given id.   Source Edit
method GuildCreateRole*(s: Session; guild: string): Role {.
base, gcsafe
.}
Creates a new role in the guild   Source Edit
method GuildEditRolePosition*(s: Session; guild: string; roles: seq[Role]): seq[Role] {.
base, gcsafe
.}
Edits the positions of a guilds roles roles and returns the new roles order   Source Edit
method GuildEditRole*(s: Session; guild, roleid, name: string; permissions, color: int;
                     hoist, mentionable: bool): Role {.
base, gcsafe
.}
Edits a role   Source Edit
method GuildDeleteRole*(s: Session; guild, roleid: string) {.
base, gcsafe
.}
Deletes a role   Source Edit
method GuildPruneCount*(s: Session; guild: string; days: int): int {.
base, gcsafe
.}
Returns the number of members who would get kicked during a prune operation   Source Edit
method GuildPruneBegin*(s: Session; guild: string; days: int): int {.
base, gcsafe
.}
Begins a prune operation and kicks all members who haven't been active for N days   Source Edit
method GuildVoiceRegions*(s: Session; guild: string): seq[VoiceRegion] {.
base, gcsafe
.}
Lists all voice regions in a guild   Source Edit
method GuildInvites*(s: Session; guild: string): seq[Invite] {.
base, gcsafe
.}
Lists all guild invites   Source Edit
method GuildIntegrations*(s: Session; guild: string): seq[Integration] {.
base, gcsafe
.}
Lists all guild integrations   Source Edit
method GuildIntegrationCreate*(s: Session; guild, typ, id: string) {.
base, gcsafe
.}
Creates a new guild integration   Source Edit
method GuildIntegrationEdit*(s: Session; guild, integrationid: string;
                            behaviour, grace: int; emotes: bool) {.
base, gcsafe
.}
Edits a guild integration   Source Edit
method GuildIntegrationDelete*(s: Session; guild, integration: string) {.
base, gcsafe
.}
Deletes a guild Integration   Source Edit
method GuildIntegrationSync*(s: Session; guild, integration: string) {.
base, gcsafe
.}
Syncs an existing guild integration   Source Edit
method GetGuildEmbed*(s: Session; guild: string): GuildEmbed {.
base, gcsafe
.}
Gets a GuildEmbed   Source Edit
method GuildEmbedEdit*(s: Session; guild: string; enabled: bool; channel: string): GuildEmbed {.
base, gcsafe
.}
Edits a GuildEmbed   Source Edit
method GetInvite*(s: Session; code: string): Invite {.
base, gcsafe
.}
Gets an invite with code   Source Edit
method InviteDelete*(s: Session; code: string): Invite {.
base, gcsafe
.}
Deletes an invite   Source Edit
method Me*(s: Session): User {.
base, gcsafe
.}
Returns the current user   Source Edit
method GetUser*(s: Session; userid: string): User {.
base, gcsafe
.}
Gets a user   Source Edit
method EditUsername*(s: Session; name: string): User {.
base, gcsafe
.}
Edits the current users username   Source Edit
method EditAvatar*(s: Session; avatar: string): User {.
base, gcsafe
.}
Changes the current users avatar   Source Edit
method Guilds*(s: Session): seq[UserGuild] {.
base, gcsafe
.}
Lists the current users guilds   Source Edit
method LeaveGuild*(s: Session; guild: string) {.
base, gcsafe
.}
Makes the current user leave the specified guild   Source Edit
method ActivePrivateChannels*(s: Session): seq[DChannel] {.
base, gcsafe
.}
Lists all active DM channels   Source Edit
method PrivateChannelCreate*(s: Session; recipient: string): DChannel {.
base, gcsafe
.}
Creates a new DM channel   Source Edit
method VoiceRegions*(s: Session): seq[VoiceRegion] {.
base, gcsafe
.}
Lists all voice regions   Source Edit
method WebhookCreate*(s: Session; channel, name, avatar: string): Webhook {.
base, gcsafe
.}
Creates a webhook   Source Edit
method ChannelWebhooks*(s: Session; channel: string): seq[Webhook] {.
base, gcsafe
.}
Lists all webhooks in a channel   Source Edit
method GuildWebhooks*(s: Session; guild: string): seq[Webhook] {.
base, gcsafe
.}
Lists all webhooks in a guild   Source Edit
method GetWebhookWithToken*(s: Session; webhook, token: string): Webhook {.
base, gcsafe
.}
Gets a webhook with a token   Source Edit
method WebhookEdit*(s: Session; webhook, name, avatar: string): Webhook {.
base, gcsafe
.}
Edits a webhook   Source Edit
method WebhookEditWithToken*(s: Session; webhook, token, name, avatar: string): Webhook {.
base, gcsafe
.}
Edits a webhook with a token   Source Edit
method WebhookDelete*(s: Session; webhook: string): Webhook {.
base, gcsafe
.}
Deletes a webhook   Source Edit
method WebhookDeleteWithToken*(s: Session; webhook, token: string): Webhook {.
base, gcsafe
.}
Deltes a webhook with a token   Source Edit
method ExecuteWebhook*(s: Session; webhook, token: string; wait: bool;
                      payload: WebhookParams) {.
base, gcsafe
.}
Executes a webhook   Source Edit