Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
Namediscordconnect
Related Guide Pagehttps://guide.denizenscript.com/guides/expanding/ddiscordbot.html
Syntaxdiscordconnect [id:<id>] [token:<secret>] (intents:<intent>|...)
Short DescriptionConnects to Discord.
Full DescriptionConnects to Discord.

The connection will automatically specify the following gateway intents:
GUILD_MEMBERS, GUILD_EMOJIS_AND_STICKERS, GUILD_MESSAGES, GUILD_MESSAGE_REACTIONS, DIRECT_MESSAGES, DIRECT_MESSAGE_REACTIONS, MESSAGE_CONTENT
Optionally specify additional Gateway Intents to use as a list of any of:
GUILD_BANS, GUILD_WEBHOOKS, GUILD_INVITES, GUILD_VOICE_STATES, GUILD_PRESENCES, GUILD_MESSAGE_TYPING, DIRECT_MESSAGE_TYPING

use "intents:clear|SOME_INTENT|etc" (ie the first entry as "clear") to clear out default intents and use only your manually specified choices.

Note that you need to enable the 'members' and 'message content' intent on your bot in Discord bot settings https://discord.com/developers/applications
And also may need to manually enable other intents if you specify any.
If the members intent is not enabled, a significant amount of dDiscordBot's functionality will not work.

Store your Discord bot token in the Denizen secrets file at 'plugins/Denizen/secrets.secret'. Refer to ObjectType:SecretTag for usage info.

The command should usually be ~waited for. See Language:~waitable.
Related Tags<discord[<bot_id>]> Returns the Discord bot for the given bot ID.
Usage Example
# Use to connect to Discord with a token stored in secret file 'plugins/Denizen/secrets.secret' and send a message once connected.
- ~discordconnect id:mybot token:<secret[discord_bot_token]>
- discordmessage id:mybot channel:<[my_log_channel]> "Connected!"
Groupexternal
RequiresdDiscordBot
Sourcehttps://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordConnectCommand.java#L52