Functionalities
Other
$messageSlice
Slices out defined arguments and returns everything else in the command/message.

FUNCTION USAGE

  • $messageSlice[number]
  • $messageSlice[>number]
  • $messageSlice[<number]
  • $messageSlice[-number]

Properties:

number - Slices out everything and only returns the data in the defined argument. >number - Slices out the arguments before the argument number and returns everything after. <number - Slices out the arguments after the argument number and returns everything before. -number - Slices out the defined argument and returns everything else.

Example 1:

1
bot.Command({
2
name: "say",
3
code: `
4
$messageSlice[4]
5
`
6
})
Copied!
Input
Output
Reason
!say Hello I'm a Discord bot and I like to party!
Discord
Defining only the 4th argument in the $messageSlice will make the bot slice out everything from the message and return just the 4th argument.

Example 2:

1
bot.Command({
2
name: "say",
3
code: `
4
$messageSlice[>4]
5
`
6
})
Copied!
Input
Output
Reason
!say Hello I'm a Discord bot and I like to party!
bot and I like to party!
Defining as >4 will make the bot slice off the first 4 arguments and return everything after that.

Example 3:

1
bot.Command({
2
name: "say",
3
code: `
4
$messageSlice[<4]
5
`
6
})
Copied!
Input
Output
Reason
!say Hello I'm a Discord bot and I like to party!
Hello I'm a Discord
Defining as <4 will make the bot slice out everything after the 4th argument, resulting in only returning the first 4 arguments

Example 4:

1
bot.Command({
2
name: "say",
3
code: `
4
$messageSlice[-4]
5
`
6
})
Copied!
Input
Output
Reason
!say Hello I'm a Discord bot and I like to party!
Hello I'm a bot and I like to party!
Defining as -4 will make the bot slice out only the 4th argument and return the rest of the message.
Last modified 4mo ago
Copy link
Contents
Properties: