Name | discord |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discord [id:<id>] [disconnect/add_role/start_typing/remove_role/status (status:<status>) (activity:<activity>)/rename] (<value>) (message_id:<id>) (channel:<channel>) (user:<user>) (group:<group>) (role:<role>) (url:<url>) |
Short Description | Interacts with Discord. |
Full Description | Interacts with Discord.
Commands may fail if the bot does not have permission within the Discord group to perform them. When setting the status of the Discord bot, the status argument can be: ONLINE, DND, IDLE, or INVISIBLE, and the activity argument can be: PLAYING, STREAMING, LISTENING, or WATCHING. Streaming activity requires a 'url:' input. The command should always be ~waited for. See ~waitable. |
Related Tags | <discord[<bot_id>]> Returns the Discord bot for the given bot ID.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordCommand.java#L38 |
Name | discordban |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordban (id:<bot>) ({add}/remove) [user:<user>] [group:<group>] (reason:<reason>) (deletion_timeframe:<time>/{0s}) |
Short Description | Bans or unbans a member from a group. |
Full Description | Bans or unbans a member from a group.
To ban a user, use the "add" argument. To unban a user, use the "remove" argument. The group is required for both "add" and "remove" arguments, but "reason" can only be used with "add". Reasons show up in the group's Audit Logs. The "deletion_timeframe" argument will, if set, delete all messages sent by the user being banned within the timeframe given. The timeframe defaults to 0 seconds, which will not delete any messages. The timeframe cannot be greater than 7 days. This argument can only be used when adding a ban using the "add" argument, although it is not required. The command should usually be ~waited for. See ~waitable. |
Related Tags | <DiscordUserTag.is_banned[<group>]> returns if the user is banned from a certain group.
<DiscordGroupTag.banned_members> returns a list of all banned members in a group.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordBanCommand.java#L27 |
Name | discordcommand |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordcommand (id:<bot>) [create/delete] (group:<group>) (name:<name>) (type:{slash}/user/message) (description:<description>) (options:<options>) |
Short Description | Manages Discord application commands. |
Full Description | Manages Discord application commands.
You can create a new command, edit the permissions of an existing command, or delete an existing command. To create (or delete) a command in a specific Discord guild, use the "group" argument. If not present, a global command will be created. NOTE: Global commands take up to an hour to register. When creating, both a name and description are required. Commands can be slash commands - activated via typing "/", message commands - activated by right-clicking a message, or user commands - activated by right-clicking a user. "Description" and "options" are only valid for slash commands. The "options" argument controls the command parameters. It is a MapTag of ordered MapTags that can sometimes hold ordered MapTags. It is recommended to use definemap or a data script key when creating commands. All option MapTags must have "type", "name", and "description" keys, with an optional "required" key (defaulting to true). The "type" key can be one of: STRING, INTEGER, BOOLEAN, USER, CHANNEL, ROLE, MENTIONABLE, NUMBER, ATTACHMENT. Additionally, the option map can include a "choices" key, which is a MapTag of ordered MapTags that have a "name" (what displays to the user) and a "value" (what gets passed to the client). Instead of choices, the option map can also include an "autocomplete" key controlling whether dynamic suggestions can be provided to the client (defaulting to false). See on discord command autocomplete. Editing application command permissions has been moved to the "Integrations" section in the server settings. Read more about it here: https://discord.com/blog/slash-commands-permissions-discord-apps-bots You DO NOT need to create a command on startup every time! Once a command is created, it will persist until you delete it. Using the "create" instruction on an existing command will update it. Commands and replies to interactions have limitations. See https://gist.github.com/MinnDevelopment/b883b078fdb69d0e568249cc8bf37fe9. See also Discord's internal API documentation for commands: https://discord.com/developers/docs/interactions/application-commands Generally used alongside discordinteraction The command should usually be ~waited for. See ~waitable. |
Related Tags | <entry[saveName].command> returns the DiscordCommandTag of a command upon creation, when the command is ~waited for.
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordCommandCommand.java#L40 |
Name | discordconnect |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordconnect [id:<id>] [token:<secret>] (intents:<intent>|...) |
Short Description | Connects to Discord. |
Full Description | Connects 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 SecretTag for usage info. The command should usually be ~waited for. See ~waitable. |
Related Tags | <discord[<bot_id>]> Returns the Discord bot for the given bot ID.
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordConnectCommand.java#L52 |
Name | discordcreatechannel |
Syntax | discordcreatechannel (id:<bot>) [group:<group>] [name:<name>] (description:<description>) (type:<type>) (category:<category_id>) (position:<#>) (roles:<list>) (users:<list>) |
Short Description | Creates text channels on Discord. |
Full Description | Creates text channels on Discord.
This functionality requires the Manage Channels permission. You can optionally specify the channel description (aka "topic") with the "description" argument. You can optionally specify the channel type. Valid types are TEXT, NEWS, CATEGORY, and VOICE. Only text and news channels can have a description. Categories cannot have a parent category. You can optionally specify the channel's parent category with the "category" argument. By default, the channel will not be attached to any category. You can optionally specify the channel's position in the list as an integer with the "position" argument. You can optionally specify the roles or users that are able to view the channel. The "roles" argument takes a list of DiscordRoleTags, and the "users" argument takes a list of DiscordUserTags. Specifying either of these arguments will create a private channel (hidden for anyone not in the lists). The command can be ~waited for. See ~waitable. |
Related Tags | <entry[saveName].channel> returns the DiscordChannelTag of a channel upon creation when the command is ~waited for.
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordCreateChannelCommand.java#L30 |
Name | discordcreatethread |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordcreatethread (id:<bot>) [name:<name>] [message:<message>/parent:<channel> (private)] |
Short Description | Creates a new Discord thread. |
Full Description | Creates a new Discord thread.
You must specify the bot object ID, and the thread name. You can either specify a full DiscordMessageTag instance to create a thread based on that message, OR specify a DiscordChannelTag parent and optionally mark it private (otherwise it's public). The command can be ~waited for. See ~waitable. |
Related Tags | <entry[saveName].created_thread> returns the newly created thread.
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordCreateThreadCommand.java#L30 |
Name | discordinteraction |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordinteraction [defer/reply/delete] [interaction:<interaction>] (ephemeral) (rows:<rows>) (<message>) (embed:<embed>|...) (attach_files:<map>) |
Short Description | Manages Discord interactions. |
Full Description | Manages Discord interactions.
You can defer, reply to, edit, or delete an interaction. These instructions all require the "interaction" argument. The "ephemeral" argument can be used to have the reply message be visible to that one user. You can defer an interaction before replying, which is useful if your reply may take more than a few seconds to be selected. If you defer, the 'ephemeral' option can only be set by the defer - you cannot change it with the later reply. Replying to an interaction uses similar logic to normal messaging. See discordmessage. If you deferred without using 'ephemeral', the 'delete' option will delete the "Thinking..." message. Ephemeral replies cannot have files. Slash commands, and replies to interactions, have limitations. See https://gist.github.com/MinnDevelopment/b883b078fdb69d0e568249cc8bf37fe9. Generally used alongside discordcommand The command can be ~waited for. See ~waitable. |
Related Tags | <entry[saveName].command> returns the DiscordCommandTag of a slash command upon creation, when the command is ~waited for.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordInteractionCommand.java#L31 |
Name | discordmessage |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordmessage (id:<id>) [reply:<message>/edit:<message>/channel:<channel>/user:<user>] (<message>) (no_mention) (rows:<rows>) (embed:<embed>|...) (attach_files:<map>) (post_title:<name>) |
Short Description | Sends a message to a Discord channel. |
Full Description | Sends a message to a Discord channel.
Command may fail if the bot does not have permission within the Discord group to send a message in that channel. You can send the message to: a channel, user, or in reply to a previous message. If sending as a reply, optionally use "no_mention" to disable the default reply pinging the original user. Channels can be specified as either a copied ID, or using any tag that returns a valid DiscordChannelTag. To get IDs, enable "Developer Mode" in your Discord settings, then right click on the channel and press "Copy ID". You can edit an existing message by using "edit:<message>". You can use "attach_file_name:<name>" and "attach_file_text:<text>" to attach a text file with longer content than a normal message allows. Alternatively, you can use "attach_files:<map>" to attach files as a MapTag of the name of the file to the text or a BinaryTag. To send embeds, use "embed:<embed>|...". You can use "rows" to attach action rows of components, such as buttons to the message, using DiscordButtonTag, and DiscordSelectionTag. You can send a message into a Forum Channel with "post_title" specified to create a post in that forum. The command can be ~waited for. See ~waitable. |
Related Tags | <entry[saveName].message> returns the DiscordMessageTag of the sent message, when the command is ~waited for.
<discord[mybot].group[Denizen].channel[bot-spam]> is an example of a tag that will return an appropriate channel object for a named channel in a named group.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordMessageCommand.java#L43 |
Name | discordmodal |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordmodal [interaction:<interaction>] [name:<name>] [rows:<rows>] (title:<title>) |
Short Description | Manages Discord modals. |
Full Description | With this command you can respond to an interaction using a modal.
A "modal" is a popup window that presents the user with a form to fill out. You can specify the modal's internal name for matching with in events. You can specify the title as text to display to the user. You can specify rows of user-inputs using DiscordTextInputTag. At time of writing, Selection input is not supported. You can listen to the responses to forms using discord modal submitted. You cannot defer an interaction before using a modal. It must be sent immediately. Note that the interaction can be any button or application command, but cannot be a modal submission - you cannot reply to a modal submit with a second modal. The command can be ~waited for. See ~waitable. |
Related Tags | None
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordModalCommand.java#L34 |
Name | discordreact |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordreact (id:<bot>) (channel:<channel>) [message:<message>] [add/remove/clear] [reaction:<reaction>/all] (user:<user>) |
Short Description | Manages message reactions on Discord. |
Full Description | Manages message reactions on Discord.
The message can be a DiscordMessageTag, or just the message ID, with a channel ID also given. You can add or remove reactions from the bot, or clear all reactions of a specific ID, or clear all reactions from a message entirely. Reactions can be unicode symbols, or custom emoji IDs. Optionally specify a user for 'remove' to remove only a specific user's reaction. 'Add' requires basic add-reaction permissions. 'Clear' requires 'manage messages' permission. For custom emoji, the ID is the numeric ID. For default emoji, the ID is the unicode symbol of the emoji. In both cases, you can copy the correct value by typing the emoji into Discord and prefixing it with a "\" symbol, like "\:myemoji:" and sending it - the sent message will show the internal form of the emoji. The command can be ~waited for. See ~waitable. |
Related Tags | <DiscordMessageTag.reactions> Returns a list of reaction on this message.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordReactCommand.java#L33 |
Name | discordtimeout |
Related Guide Page | https://guide.denizenscript.com/guides/expanding/ddiscordbot.html |
Syntax | discordtimeout (id:<bot>) ({add}/remove) [user:<user>] [group:<group>] (reason:<reason>) (duration:<duration>/{60s}) |
Short Description | Puts a user in timeout. |
Full Description | Puts a user in timeout.
To put a user in timeout, use the "add" argument. To remove the timeout, use the "remove" argument. The group is required for both "add" and "remove" arguments, but "reason" can only be used with "add". Reasons show up in the group's Audit Logs. The timeout duration defaults to 60 seconds. The duration cannot be greater than 28 days. This argument can only be used when putting a user in timeout using the "add" argument, although it is not required. The command can be ~waited for. See ~waitable. |
Related Tags | <DiscordUserTag.is_timed_out[<group>]> returns if the user is timed out in a certain group.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | external |
Requires | dDiscordBot |
Source | https://github.com/DenizenScript/dDiscordBot/blob/master/src/main/java/com/denizenscript/ddiscordbot/commands/DiscordTimeoutCommand.java#L31 |