2022-11-18 19:23:12 +07:00
|
|
|
# Slash command
|
2022-08-15 19:51:01 +07:00
|
|
|
|
2022-06-13 18:48:43 +07:00
|
|
|
# Slash Command (no options)
|
|
|
|
|
|
|
|
|
|
### Demo
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
2022-11-18 19:23:12 +07:00
|
|
|
### Code
|
2022-06-13 18:48:43 +07:00
|
|
|
|
|
|
|
|
```js
|
2022-06-16 01:31:18 +07:00
|
|
|
await message.channel.sendSlash('botid', 'aiko')
|
2022-06-13 18:48:43 +07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Slash Command + Sub option (group)
|
|
|
|
|
|
2022-11-18 19:23:12 +07:00
|
|
|
### Demo
|
2022-06-13 18:48:43 +07:00
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
### Code test
|
|
|
|
|
|
2022-11-18 19:23:12 +07:00
|
|
|
```js
|
|
|
|
|
await message.channel.sendSlash('450323683840491530', 'animal chat', 'bye')
|
2022-06-13 18:48:43 +07:00
|
|
|
```
|
|
|
|
|
|
2022-11-18 19:23:12 +07:00
|
|
|
# Slash Command with Attachment
|
2022-06-13 18:48:43 +07:00
|
|
|
|
|
|
|
|
### Demo
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
### Code test
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
const { MessageAttachment } = require('discord.js-selfbot-v13')
|
|
|
|
|
const fs = require('fs')
|
|
|
|
|
const a = new MessageAttachment(fs.readFileSync('./wallpaper.jpg') , 'test.jpg')
|
2022-06-16 01:31:18 +07:00
|
|
|
await message.channel.sendSlash('718642000898818048', 'sauce', a)
|
2022-06-13 18:48:43 +07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Result
|
|
|
|
|
|
|
|
|
|

|