Minor change (description)

- feat(ApplicationCommand): add `min_length` and `max_length` for string option (v13) #8217 (Djs v13.9)
- fix(Interaction): Button.click & Menu.select return Snowflake
- feat(MessagePayload): Send Activity message
This commit is contained in:
March 7th
2022-07-07 16:10:51 +07:00
parent 578bc0adde
commit 010272fba7
12 changed files with 90 additions and 23 deletions

View File

@@ -214,7 +214,7 @@ class MessageSelectMenu extends BaseMessageComponent {
* Mesage select menu
* @param {Message} message The message this select menu is for
* @param {Array<string>} values The values of the select menu
* @returns {Promise<boolean>}
* @returns {Promise<Snowflake>}
*/
async select(message, values = []) {
// Github copilot is the best :))
@@ -240,6 +240,7 @@ class MessageSelectMenu extends BaseMessageComponent {
`[SELECT_MENU_INVALID_VALUE] The value ${check_} is invalid. Please use a valid value ${validValue.join(', ')}`,
);
}
const nonce = SnowflakeUtil.generate();
await message.client.api.interactions.post({
data: {
type: 3, // ?
@@ -255,10 +256,10 @@ class MessageSelectMenu extends BaseMessageComponent {
type: 3, // Select Menu
values,
},
nonce: SnowflakeUtil.generate(),
nonce,
},
});
return true;
return nonce;
}
}