discord.js-selfbot-v13/Document/SlashCommand.md

52 lines
1.5 KiB
Markdown
Raw Normal View History

2022-11-18 12:23:12 +00:00
# Slash command
2022-08-15 12:51:01 +00:00
2022-06-13 11:48:43 +00:00
# Slash Command (no options)
### Demo
![image](https://user-images.githubusercontent.com/71698422/173344527-86520c60-64cd-459c-ba3b-d35f14279f93.png)
2022-11-18 12:23:12 +00:00
### Code
2022-06-13 11:48:43 +00:00
```js
2022-06-15 18:31:18 +00:00
await message.channel.sendSlash('botid', 'aiko')
2022-06-13 11:48:43 +00:00
```
# Slash Command + Sub option (group)
2022-11-18 12:23:12 +00:00
### Demo
2022-06-13 11:48:43 +00:00
![image](https://user-images.githubusercontent.com/71698422/173346438-678009a1-870c-49a2-97fe-8ceed4f1ab64.png)
### Code test
2022-11-18 12:23:12 +00:00
```js
await message.channel.sendSlash('450323683840491530', 'animal chat', 'bye')
2022-06-13 11:48:43 +00:00
```
2022-11-18 12:23:12 +00:00
# Slash Command with Attachment
2022-06-13 11:48:43 +00:00
### Demo
![image](https://user-images.githubusercontent.com/71698422/173346964-0c44f91f-e5bf-43d4-8401-914fc3e92073.png)
### 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-15 18:31:18 +00:00
await message.channel.sendSlash('718642000898818048', 'sauce', a)
2022-06-13 11:48:43 +00:00
```
### Result
![image](https://user-images.githubusercontent.com/71698422/173347075-5c8a1347-3845-489e-956b-63975911b6e0.png)
2022-06-16 05:34:03 +00:00
# Events
2022-06-15 18:31:18 +00:00
2022-06-16 05:34:03 +00:00
- [interactionCreate](https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-interactionCreate)
- [interactionFailure](https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-interactionFailure)
- [interactionSuccess](https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-interactionSuccess)
2022-08-04 12:03:02 +00:00
- [interactionModalCreate](https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-interactionModalCreate)