SpaceCommand
Triggers when a message of any kind from a user is sent in a guild channel. Does not respond to bots.

You can used limiters like $onlyIf and $onlyIfMessageContains as well as other command functions to alter the nature of the space command.

Name can be anything but DO NOT DUPLICATE. Causes conflictions because the bot does not know which space command of the same name to execute.

Example 1: The event placed in the main file. When the bot is mentioned with no content, it will trigger with the response.

1
bot.SpaceCommand({
2
name: "pingForPrefix",
3
code: `
4
Prefix: $getServerVar[Prefix]
5
Set a custom prefix with: **$getServerVar[Prefix]setprefix <newPrefix>**
6
$onlyIf[$message[2]==;]
7
$onlyIfMessageContains[<@$client[id]>;<@!$client[id]>;]
8
`
9
})
Copied!

Example 2: The event placed in the event handler (its own file). When the bot is mentioned with no content, it will trigger with the response.

1
module.exports.SpaceCommand = ({
2
name: "pingForPrefix",
3
code: `
4
Prefix: $getServerVar[Prefix]
5
Set a custom prefix with: **$getServerVar[Prefix]setprefix <newPrefix>**
6
$onlyIf[$message[2]==;]
7
$onlyIfMessageContains[<@$client[id]>;<@!$client[id]>;]
8
`
9
})
Copied!
Last modified 5mo ago
Copy link