Docs: Update
This commit is contained in:
parent
21261de111
commit
3e23407ed0
@ -1,17 +0,0 @@
|
|||||||
## HTTP options:
|
|
||||||
- Change API v9 to v10
|
|
||||||
```js
|
|
||||||
/* If you want to change the API version from v9 to v10, here are the instructions */
|
|
||||||
const { Client } = require('discord.js-selfbot-v13');
|
|
||||||
const client = new Client({
|
|
||||||
ws: {
|
|
||||||
version: 10
|
|
||||||
},
|
|
||||||
http: {
|
|
||||||
version: 10,
|
|
||||||
header: {
|
|
||||||
cookie: '', // If you want to use cookies, here is the place
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
@ -1,10 +1,4 @@
|
|||||||
# Slash command demo
|
# Slash command
|
||||||
- Support Autocomplete feature (half)
|
|
||||||
- Unused `guild.searchInteraction()` (Deleted)
|
|
||||||
|
|
||||||
# <strong>BREAKING CHANGE: Using Slash Command (Sub Command / Sub Group Command) will not accept subCommand argument in args. That means Command Name needs to be changed same as Discord Client</strong>
|
|
||||||
|
|
||||||
# All image demo : v2.3
|
|
||||||
|
|
||||||
# Slash Command (no options)
|
# Slash Command (no options)
|
||||||
|
|
||||||
@ -12,38 +6,25 @@
|
|||||||
|
|
||||||
![image](https://user-images.githubusercontent.com/71698422/173344527-86520c60-64cd-459c-ba3b-d35f14279f93.png)
|
![image](https://user-images.githubusercontent.com/71698422/173344527-86520c60-64cd-459c-ba3b-d35f14279f93.png)
|
||||||
|
|
||||||
`vietnamese .-.`
|
### Code
|
||||||
|
|
||||||
### Code test
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
await message.channel.sendSlash('botid', 'aiko')
|
await message.channel.sendSlash('botid', 'aiko')
|
||||||
```
|
```
|
||||||
|
|
||||||
### Result
|
|
||||||
|
|
||||||
![image](https://user-images.githubusercontent.com/71698422/173346835-c747daa5-cd99-41df-9d28-fecf3b7e1ac9.png)
|
|
||||||
|
|
||||||
# Slash Command + Sub option (group)
|
# Slash Command + Sub option (group)
|
||||||
|
|
||||||
### Demo (v2.5)
|
### Demo
|
||||||
|
|
||||||
![image](https://user-images.githubusercontent.com/71698422/173346438-678009a1-870c-49a2-97fe-8ceed4f1ab64.png)
|
![image](https://user-images.githubusercontent.com/71698422/173346438-678009a1-870c-49a2-97fe-8ceed4f1ab64.png)
|
||||||
|
|
||||||
### Code test
|
### Code test
|
||||||
|
|
||||||
```diff
|
```js
|
||||||
v2.5
|
await message.channel.sendSlash('450323683840491530', 'animal chat', 'bye')
|
||||||
- await message.channel.sendSlash('450323683840491530', 'animal', 'chat', 'bye')
|
|
||||||
v2.6+
|
|
||||||
+ await message.channel.sendSlash('450323683840491530', 'animal chat', 'bye')
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Result
|
# Slash Command with Attachment
|
||||||
|
|
||||||
![image](https://user-images.githubusercontent.com/71698422/173346620-ba54f0d8-efc6-4f40-9093-34feda171a3c.png)
|
|
||||||
|
|
||||||
# Slash Command with Attachment (must use MessageAttachment)
|
|
||||||
|
|
||||||
### Demo
|
### Demo
|
||||||
|
|
||||||
|
@ -173,6 +173,7 @@ class GuildMemberManager extends CachedManager {
|
|||||||
* guild.members.fetch({ query: 'hydra', limit: 1 })
|
* guild.members.fetch({ query: 'hydra', limit: 1 })
|
||||||
* .then(console.log)
|
* .then(console.log)
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
|
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/FetchGuildMember.md}
|
||||||
*/
|
*/
|
||||||
fetch(options) {
|
fetch(options) {
|
||||||
if (!options || !options?.query) {
|
if (!options || !options?.query) {
|
||||||
|
@ -375,6 +375,7 @@ class ClientUser extends User {
|
|||||||
* @example
|
* @example
|
||||||
* // Set the client user's presence
|
* // Set the client user's presence
|
||||||
* client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });
|
* client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });
|
||||||
|
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/RichPresence.md}
|
||||||
*/
|
*/
|
||||||
setPresence(data) {
|
setPresence(data) {
|
||||||
return this.client.presence.set(data);
|
return this.client.presence.set(data);
|
||||||
@ -419,6 +420,7 @@ class ClientUser extends User {
|
|||||||
* @example
|
* @example
|
||||||
* // Set the client user's activity
|
* // Set the client user's activity
|
||||||
* client.user.setActivity('discord.js', { type: 'WATCHING' });
|
* client.user.setActivity('discord.js', { type: 'WATCHING' });
|
||||||
|
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/RichPresence.md}
|
||||||
*/
|
*/
|
||||||
setActivity(name, options = {}) {
|
setActivity(name, options = {}) {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
@ -444,21 +446,21 @@ class ClientUser extends User {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an invite [Friend Invites]
|
* Create an invite [Friend Invites]
|
||||||
* @param {CreateInviteOptions} [options={}] The options for creating the invite [maxAge and maxUses are available]
|
* maxAge: 86400 | maxUses: 0
|
||||||
* @returns {Promise<Invite>}
|
* @returns {Promise<Invite>}
|
||||||
* @see https://github.com/13-05/hidden-disc-docs#js-snippet-for-creating-friend-invites
|
* @see {@link https://github.com/13-05/hidden-disc-docs#js-snippet-for-creating-friend-invites}
|
||||||
* @example
|
* @example
|
||||||
* // Options not working
|
* // Options not working
|
||||||
* client.user.getInvite();
|
* client.user.getInvite();
|
||||||
* .then(console.log)
|
* .then(console.log)
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
async getInvite({ maxAge = 86400, maxUses = 0 } = {}) {
|
async getInvite() {
|
||||||
const data = await this.client.api.users['@me'].invites.post({
|
const data = await this.client.api.users['@me'].invites.post({
|
||||||
data: {
|
data: {
|
||||||
validate: null,
|
validate: null,
|
||||||
max_age: maxAge,
|
max_age: 86400,
|
||||||
max_uses: maxUses,
|
max_uses: 0,
|
||||||
target_type: 2,
|
target_type: 2,
|
||||||
temporary: false,
|
temporary: false,
|
||||||
},
|
},
|
||||||
|
@ -437,21 +437,21 @@ class TextBasedChannel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send Slash to this channel
|
* Send Slash to this channel
|
||||||
* @param {UserResolvable} bot Bot user
|
* @param {UserResolvable} bot Bot user (BotID, not applicationID)
|
||||||
* @param {string} commandString Command name (and sub / group formats)
|
* @param {string} commandString Command name (and sub / group formats)
|
||||||
* @param {...?any|any[]} args Command arguments
|
* @param {...?any|any[]} args Command arguments
|
||||||
* @returns {Promise<InteractionResponse>}
|
* @returns {Promise<InteractionResponse>}
|
||||||
* @example
|
* @example
|
||||||
* // Send Slash to this channel
|
* // Send a basic slash
|
||||||
* // Demo:
|
* channel.sendSlash('botid', 'ping)
|
||||||
* // + BotID: "123456789012345678"
|
* .then(console.log)
|
||||||
* // + CommandName: "embed"
|
* .catch(console.error);
|
||||||
* // + Args: "title", "description", "author", 'color' (Optional)
|
* @example
|
||||||
* channel.sendSlash('123456789012345678', 'embed', 'title', 'description', 'author', '#00ff00')
|
* // Send a remote file
|
||||||
* // Send embed with Title and Color:
|
* channel.send('botid', 'emoji upload', 'https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048', 'test')
|
||||||
* channel.sendSlash('123456789012345678', 'embed', 'title', undefined, undefined, '#00ff00')
|
* .then(console.log)
|
||||||
* // CommandName is Group Command / Sub Command
|
* .catch(console.error);
|
||||||
* channel.sendSlash('123456789012345678', 'embed title', 'description', 'author', '#00ff00')
|
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/SlashCommand.md}
|
||||||
*/
|
*/
|
||||||
async sendSlash(bot, commandString, ...args) {
|
async sendSlash(bot, commandString, ...args) {
|
||||||
const perms =
|
const perms =
|
||||||
@ -462,7 +462,7 @@ class TextBasedChannel {
|
|||||||
throw new Error(
|
throw new Error(
|
||||||
'INTERACTION_SEND_FAILURE',
|
'INTERACTION_SEND_FAILURE',
|
||||||
`Cannot send Slash to ${this.toString()} ${
|
`Cannot send Slash to ${this.toString()} ${
|
||||||
this.recipient ? 'because user has been blocked' : 'due to missing SEND_MESSAGES permission'
|
this.recipient ? 'because bot has been blocked' : 'due to missing SEND_MESSAGES permission'
|
||||||
}`,
|
}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -485,7 +485,6 @@ class TextBasedChannel {
|
|||||||
}
|
}
|
||||||
if (!bot) throw new Error('MUST_SPECIFY_BOT');
|
if (!bot) throw new Error('MUST_SPECIFY_BOT');
|
||||||
const botId = this.client.users.resolveId(bot);
|
const botId = this.client.users.resolveId(bot);
|
||||||
// ? maybe ...
|
|
||||||
const user = await this.client.users.fetch(botId).catch(() => {});
|
const user = await this.client.users.fetch(botId).catch(() => {});
|
||||||
if (!user || !user.bot || !user.application) {
|
if (!user || !user.bot || !user.application) {
|
||||||
throw new Error('botId is not a bot or does not have an application slash command');
|
throw new Error('botId is not a bot or does not have an application slash command');
|
||||||
|
Loading…
Reference in New Issue
Block a user