Skip to content

Instantly share code, notes, and snippets.

@DodoGames7
Last active February 12, 2024 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DodoGames7/365f931749f2d22e706c83614b7fe1a7 to your computer and use it in GitHub Desktop.
Save DodoGames7/365f931749f2d22e706c83614b7fe1a7 to your computer and use it in GitHub Desktop.
aoi.js v6 slash choice example with test command
module.exports = [{
name: "create",
code: `The example slash command with choices has been created! Run the command to check out.
$createApplicationCommand[$guildID;choice;slash command choices showcase!;true;false;slash;[{
"name": "option",
"description": "options example",
"required": true,
"type": 3,
"choices" : [{
"name" : "choice 1",
"value" : "value1"
},{
"name" : "choice 2 ",
"value" : "value2"
},{
"name" : "choice 3",
"value" : "value3"
}]
}]
$onlyIf[$checkContains[$clientOwnerIDs[,];$authorID]==true;]` // Restricted to bot developers for safety
},{
name: "choice",
type: "interaction",
prototype: "slash",
$if: "old",
code: `$if[$slashOption[option]==value1]
$interactionReply[example of choice 1 reply!;;;;all;false]
$elseif[$slashOption[option]==value2]
$interactionReply[example of choice 2 reply!;;;;all;false]
$endelseif
$elseif[$slashOption[option]==value3]
$interactionReply[example of choice 3 reply!;;;;all;false]
$endelseif
$endif`
}]
// Note that this was only made for learning purposes. You can change everything to your liking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment