dimscord

Search:
Group by:
Source   Edit  

Welcome to the Dimscord Documentation!

  • If you have any errors like for example getGuildChannel doesn't exist in v1.0.0, then you can just simply do nimble install dimscord@#head if this does not work then uninstall the version you were using, or you could replace the folder from the .nimble/pkgs directory.

You can search for symbols by going to https://krisppurg.github.io/dimscord/theindex.html.

Reference

  • objects Includes the discord objects, such as Message, Guild, User, Shard, etc.
  • gateway Allows you to connect, disconnect, send gateway messages to the gateway. Like updating your status with updateStatus, requesting guild members with requestGuildMembers, joining/moving/leaving a voice channel with voiceStateUpdate.
  • restapi Interfaces with Discord's REST API, I'd recommend either stopping your bot or at least check your code like if the bot has the permissions to do this and that, for 429s the lib would at least try to re-send the request, the common ways to get 429s is reactions and you may get 429s, though this is more common in other libraries, if you were to add more reactions, I'd recommend adding some sort of cooldowns to it. (OAuth2 support will be added)
  • helpers Includes helper methods such as mentioning a user @ify channels, users, roles, etc, this includes iconUrls too. There's also helper restapi procs, e.g. guild.editRole(name=some "something"), channel.send(".."). Which'd be useful for shortening code, you can use discord.api as an alternate. Additionally, there's also a waitFor/waitForRaw which is incredibly useful for waiting for events.
  • constants Say if you were to check what verification level is the guild you can use the constants like vlHigh, vlLow, vlVeryHigh, vlMedium, this file includes permission enums like permAddReactions, permViewAuditLogs, permCreateInstantInvite, etc. Intents are also included there.
  • voice Allows you to connect to the voice gateway, play audio in voice channel, etc. Look at examples/voice.nim for reference

    For joining/leaving a voice channel, see gateway.

    Keep in mind that:

    • When you join a channel Shard.voiceConnections will store the guild_id,

    and the VoiceClient information such as the endpoint and channel_id for example. With VoiceClient you can connect to the voice client gateway so you can play audio on on_ready.

    • Playing audio for windows may be buggy, if the problem persists I'd recommend using either linux, mac, etc instead.

    For further details about voice click dimscord/voice.

    The default api version for discord api is v10, for both restapi and gateway.

Modules required

Sometimes you would need some modules in order to use in procedures, for example if you were to edit a guild member you would need to import options to provide an Option type.

  • asyncdispatch This one is needed.
  • options Optional parameters, e.g. mute = some true.
  • base64 Icons such as Guild icons or emoji image.
  • json Raw data handling (on_dispatch)

Definable options

  • -d:dimscordDebug For debugging rest, gateway and voice.
  • -d:dimscordDebugNoSubscriptionLogs No debugging PRESENCE_UPDATE|TYPING_START when guild_subscriptions is on.
  • -d:discordCompress Compress gateway payloads, by using zippy.
  • -d:discordv9 Discord API v9 is used for threads (as in discord's channel type).
  • -d:dimscordVoice Enables the voice module. Requires libsodium and libopus
  • -d:discordEtf Enables etf support for gateway, currently not the fastest as dimscord relies on json.

Exports

startSession, latency, requestGuildMembers, disconnect, voiceStateUpdate, endSession, resume, updateStatus, updateStatus, getGuildMember, editGuildOnboarding, editGuildSticker, editAutoModerationRule, addGuildMember, deleteInvite, addThreadMember, editGuild, getGuildVanityUrl, removeGuildMemberRole, getNitroStickerPacks, deleteChannel, deleteGuildEmoji, removeThreadMember, getAutoModerationRule, editApplicationCommand, deleteWebhook, beginGuildPrune, createWebhook, deleteStageInstance, getGateway, interactionResponseAutocomplete, getInvite, getGuildInvites, editGuildMember, executeSlackWebhook, editCurrentMember, getGuildPreview, triggerTypingIndicator, createGuildChannel, getThreadMembers, addMessageReaction, deleteScheduledEvent, editGuildRole, startThreadWithMessage, addChannelMessagePin, createGuildTemplate, bulkOverwriteApplicationCommands, deleteMessageReactionEmoji, deleteInteractionResponse, createAutoModerationRule, getGuildWidget, getVoiceRegions, updateUserApplicationRoleConnection, deleteGuildRole, bulkDeleteMessages, syncGuildTemplate, editUserVoiceState, createInteractionResponse, getWebhook, createGuildFromTemplate, %, editWebhook, editGuildTemplate, getApplicationCommands, getGuildApplicationCommandsPermissions, startThreadWithoutMessage, createChannelInvite, editGuildEmoji, getUser, createUserDm, getGuildEmojis, syncGuildIntegration, removeGuildMember, createStageInstance, getGuildWelcomeScreen, deleteGuildIntegration, getGuildPruneCount, createGuildRole, editScheduledEvent, editGuildMFALevel, getChannelInvites, bulkEditApplicationCommandPermissions, registerApplicationCommand, editGuildChannel, getChannelMessage, joinThread, editGuildIntegration, editGuildRolePositions, getGuildWebhooks, removeGuildBan, getUserApplicationRoleConnection, getGatewayBot, getCurrentApplication, editGuildWelcomeScreen, deleteGuild, editStageInstance, getGuildTemplate, deleteAutoModerationRule, getGuildChannels, interactionResponseMessage, searchGuildMembers, editGuildRolePosition, getChannelPins, createGroupDm, getApplicationCommand, updateApplicationRoleConnectionMetadataRecords, getCurrentUserGuilds, getGuildIntegrations, crosspostMessage, getGuildRoles, getInteractionResponse, deleteMessage, getCurrentUser, leaveGuild, setGuildNick, getGuildMembers, getGuildSticker, leaveThread, editMessage, interactionResponseModal, getMessageReactions, getChannel, listActiveGuildThreads, getThreadMember, getScheduledEvents, getChannelMessages, editCurrentUser, deleteApplicationCommand, deleteGuildChannelPermission, editInteractionResponse, deleteMessageReaction, getAutoModerationRules, getCurrentGuildMember, createGuildEmoji, getGuildOnboarding, executeGithubWebhook, getGuild, getApplicationRoleConnectionMetadataRecords, listArchivedThreads, getScheduledEvent, getGuildStickers, editGuildApplicationCommandPermissions, getGuildBan, getGuildMember, editGuildChannelPositions, getGuildVoiceRegions, deleteChannelMessagePin, getGuildBans, deleteGuildTemplate, getWebhookMessage, getScheduledEventUsers, addGuildMemberRole, getChannelWebhooks, executeWebhook, editCurrentUserVoiceState, editGuildChannelPermissions, deleteGuildSticker, getSticker, deleteWebhookMessage, getStageInstance, getGuildApplicationCommandPermissions, deleteAllMessageReactions, sendMessage, createGuildSticker, createGuild, editWebhookMessage, createScheduledEvent, getGuildAuditLogs, createGuildBan, createFollowupMessage, editGuildWidget, getGuildEmoji, ApplicationCommandType, permAllStage, TextInputStyle, endpointUsers, DispatchEvent, endpointGuildChannels, InteractionResponseType, endpointGuildCommands, endpointUserApplications, MessageComponentType, ChannelDelete, SystemChannelFlags, endpointChannelMessagesCrosspost, GuildRoleUpdate, deThreadListSync, endpointGroupRecipient, TypingStart, cdnBanners, cdnGuildMemberAvatar, endpointGuildWelcomeScreen, GuildOnboardingMode, endpointWebhookTokenGithub, endpointGuildThreadsActive, ChannelUpdate, endpointGuildOnboarding, VerificationLevel, cdnGuildSplash, endpointGuildIntegrationsSync, endpointChannelThreadsArchived, endpointChannelPins, StageInstanceDelete, GuildScheduledEventCreate, GuildMemberFlags, AttachmentFlags, permManageEmojis, GuildRoleDelete, AutoModerationRuleDelete, endpointWebhookToken, cdnAppAssets, cdnStickers, GuildNSFWLevel, MessageFlags, cdnAppIcons, ExplicitContentFilter, GuildMembersChunk, endpointApplicationRoleConnectionMetadata, endpointReactions, $, cdnChannelIcons, endpointWebhooks, endpointGuildWebhooks, endpointGuildInvites, InteractionCreate, GuildMemberUpdate, endpointGuildStickers, MessageStickerFormat, endpointChannelWebhooks, KeywordPresetType, MessageReactionAdd, endpointGuildBans, ActivityType, PremiumTier, ModerationTriggerType, endpointGuildTemplates, cdnUserAvatarDecoration, StageInstanceCreate, ThreadMembersUpdate, endpointChannelOverwrites, cdnDiscoverySplashes, cdnAppAsset, TeamMembershipState, StageInstanceUpdate, restBase, UserFlags, GuildDelete, InviteTargetType, PrivacyLevel, ChannelCreate, cdnDefaultUserAvatars, endpointGuildCommandPermission, VoiceServerUpdate, GuildMemberAdd, InviteDelete, ModerationActionType, cdnRoleIcon, RoleConnectionMetadataType, ThreadMemberUpdate, endpointGuildAutoModerationRules, cdnAppIcon, endpointGuildMembers, ForumSortOrder, cdnTeamIcon, StickerType, endpointUserGuilds, GuildScheduledEventStatus, cdnTeamIcons, endpointChannelPermissions, ThreadCreate, endpointGuildVoiceStatesUser, permAllVoice, ActivityFlags, GuildRoleCreate, ThreadListSync, PermissionFlags, GuildStickersUpdate, ThreadDelete, cdnAvatarDecorations, endpointVoiceRegions, endpointGuildPrune, MessageReactionRemove, endpointUserGuildMember, endpointChannelThreads, cdnAvatars, endpointGuildMFA, endpointGuildRegions, endpointInvites, InteractionDataType, endpointChannelMessagesThreads, AutoModerationRuleCreate, GuildScheduledEventPrivacyLevel, libVer, AutoModerationRuleUpdate, GuildBanRemove, GuildCreate, deThreadMembersUpdate, endpointWebhookMessage, EntityType, cdnGuildUsers, ChannelFlags, endpointGuildVanity, libName, endpointStickerPacks, PresenceUpdate, endpointGuildScheduledEventUsers, cdnGuildScheduledEvents, permAllChannel, MessageNotificationLevel, deInviteCreate, GuildBanAdd, GuildScheduledEventUpdate, cdnRoleIcons, AutoModerationActionExecution, endpointGuildScheduledEvents, cdnGuildMemberBanner, GuildScheduledEventDelete, endpointGlobalCommands, endpointUserApplicationRoleConnection, endpointGuildPreview, deTypingStart, MessageUpdate, endpointStageInstances, WebhooksUpdate, endpointInteractionsCallback, endpointChannelMessages, cdnGuildDiscoverySplash, AuditLogEntryType, ButtonStyle, InviteCreate, endpointGuildWidget, permAll, RoleFlags, MFALevel, ChannelPinsUpdate, InteractionType, MessageReactionRemoveEmoji, endpointGuilds, MessageActivityType, endpointGuildRoles, cdnCustomEmojis, UserUpdate, endpointOAuth2Application, cdnAttachments, endpointGuildMembersRole, GuildAuditLogEntryCreate, deGuildMembersChunk, GuildScheduledEventUserAdd, log, MessageReactionRemoveAll, ApplicationFlags, ApplicationCommandPermissionType, GuildScheduledEventUserRemove, VoiceStateUpdate, endpointStickers, cdnBase, ApplicationCommandOptionType, endpointGuildThreads, endpointChannels, endpointChannelInvites, ThreadUpdate, AuditLogChangeType, endpointWebhookTokenSlack, MessageType, MessageDeleteBulk, endpointChannelUsersThreadsArchived, GuildUpdate, cdnBanner, IntegrationExpireBehavior, cdnGuildScheduledEventCover, endpointGuildAuditLogs, UserPremiumType, cdnSplashes, endpointChannelThreadsMembers, GuildOnboardingPromptType, endpointGuildEmojis, GuildIntegrationsUpdate, cdnIcons, WebhookType, endpointGuildIntegrations, MessageCreate, GatewayIntent, endpointUserChannels, MessageDelete, log, endpointBulkDeleteMessages, endpointTriggerTyping, permAllText, GuildMemberRemove, libAgent, cdnSticker, GuildEmojisUpdate, endpointGuildMembersNick, endpointGuildMembersSearch, ForumLayout, ChannelType, VoiceSpeakingFlags, newEmoji, PartialUser, Ratelimit, newInvite, newGuild, TriggerMetadata, ApplicationCommandInteractionData, CacheTablePrefs, AuditLogChangeValue, Shard, EmbedThumbnail, GuildApplicationCommandPermissions, newOverwrite, newApplicationCommandInteractionData, PartialGuild, GameAssets, DiscordHttpError, AuditLogOptions, ApplicationCommandInteractionDataOption, UnavailableGuild, clear, newAuditLog, ApplicationCommandResolution, newMessage, VoiceClient, Suffix, User, VoiceRegion, optionIf, %%*, newTypingStart, TypingStart, newGuildTemplate, AllowedMentions, Guild, newGuildMembersChunk, StageInstance, Application, keyCheckOptBool, Invite, MessageComponent, ApplicationRoleConnectionMetadata, newGuildApplicationCommandPermissions, PartialChannel, ResolvedChannel, newUser, newActivity, newGuildChannel, Sticker, kind, getClient, VoiceEncryptionMode, %, Activity, ApplicationCommandPermission, AuditLogEntry, newSticker, ApplicationCommandOptionChoice, parseHook, SelectMenuOption, newReaction, WelcomeChannel, newStickerPack, Interaction, GuildOnboardingPrompt, getCurrentDiscordHttpError, mainClient, keyCheckStr, EmbedProvider, parseHook, EmbedField, GuildScheduledEvent, ThreadListSync, InviteCreate, newShard, Lite, RoleTag, newDiscordClient, ActivityStatus, ModerationAction, keyCheckOptInt, ApplicationCommand, newPresence, Normal, RestApi, Webhook, RoleSubscriptionData, EmbedVideo, ApplicationCommandOption, newStageInstance, newGuildBan, MentionChannel, AutoModerationRule, ApplicationRoleConnection, keyCheckBool, $, %%*, Events, MessageInteraction, InteractionApplicationCommandCallbackData, GuildPreview, newWebhook, Emoji, Presence, newApplicationCommandOption, newInviteCreate, Integration, RestError, ThreadMembersUpdate, GuildBan, DMChannel, InviteMetadata, GatewaySession, GuildOnboardingPromptOption, parseHook, DiscordClient, Overwrite, ThreadMember, newRole, newGuildPreview, GuildScheduledEventUser, newApplication, %%*, EmbedFooter, Attachment, CacheError, Ready, GuildWidgetJson, newApplicationCommandPermission, newIntegration, newInteractionData, parseHook, GuildOnboarding, InteractionCallbackDataMessage, GuildChannel, newInviteMetadata, TeamMember, Member, Role, Embed, InteractionResponse, newReady, newDMChannel, GatewayBot, GuildTemplate, VoiceState, newVoiceState, EntityMetadata, InteractionCallbackDataAutocomplete, ModerationActionExecution, newApplicationCommand, keyCheckOptStr, Reaction, InteractionCallbackDataModal, newInteraction, GuildMembersChunk, EmbedAuthor, PermObj, ActivityAssets, CacheTable, StickerPack, updateMessage, ForumTag, SomeChannel, MessageReference, VoiceEvents, fullSet, Team, DiscordFile, Message, ThreadMetadata, Channel, newMember, EmbedImage, DefaultForumReaction, AuditLog, newAuditLogEntry, getMessage, delete, edit, setNickname, deleteIntegration, memberAvatarUrl, addThreadMember, iconUrl, editSticker, followup, stripMentions, deleteChannel, computePerms, edit, defaultAvatarUrl, deleteWebhook, getCommands, $, deleteRule, deleteStageInstance, notin, leave, getMembers, stripUserMentions, mention, getMessages, edit, checkActionRow, getVanity, getThreadMembers, getRules, waitForDeletion, beginPrune, getInvites, edit, edit, getBan, iconUrl, getGuildWidget, deleteEmoji, computePerms, deferResponse, newSelectMenu, iconUrl, getInvites, waitForReply, searchMembers, getIntegrations, clearReactions, stripChannelMentions, update, delete, @, deleteSticker, waitForRaw, send, getSelf, add, createStageInstance, getWebhooks, edit, @, reply, editRule, computePerms, getRule, getReactions, in, joinThread, waitForReaction, getThreadMember, editMember, newMenuOption, editStageInstance, removeMember, preview, newThread, editEmoji, removeReactionEmoji, memberBanner, delete, getBans, delete, deleteRole, getResponse, @, $, removePin, react, remove, edit, timestamp, newButton, @, createBotInvite, reply, bulkRegisterCommands, getScheduledEvents, delete, orTimeout, suggest, permCheck, getRegions, waitFor, getAuditLogs, pin, editRole, newActionRow, reference, getScheduledEvent, getEventUsers, event, waitToJoinVoice, waitForInternal, createChannel, createInvite, removeRole, registerCommand, addRole, getCommand, startThread, removeBan, guildBanner, len, edit, waitForComponentUse, getPruneCount, stripRoleMentions, add, sendModal, leaveThread, delete, ban, getPins, getMember, eventCover, perms, removeReaction, avatarUrl, getWebhooks, startSession, reconnect, VoiceOp, waitForReady, playYTDL, pause, stopPlaying, unpause, playFFMPEG, sendAudioPacket, libsodium_fn, elapsed, selectProtocol, play, disconnect, sendSpeaking, resume