chore(release): version

This commit is contained in:
Cinnamon
2022-06-26 13:40:26 +07:00
parent c097deeab4
commit 736238f3df
11 changed files with 78 additions and 29 deletions

View File

@@ -659,7 +659,7 @@ class Guild extends AnonymousGuild {
resolve(
this.client.users.cache
.get(botId)
?.applications?.cache?.find(
?.application?.commands?.cache?.find(
c => (c.name === query && c.type == type) || c.type == ApplicationCommandTypes[type],
),
);
@@ -1510,6 +1510,37 @@ class Guild extends AnonymousGuild {
}
}
/**
* Add Integrations to the guild
* @param {Snowflake} applicationId Application (ID) target
* @returns {Promise<void>}
*/
async addIntegration(applicationId) {
if (!this.me.permissions.has('MANAGE_WEBHOOKS')) {
throw new Error('MISSING_PERMISSIONS', 'MANAGE_WEBHOOKS');
}
if (!this.me.permissions.has('MANAGE_GUILD')) {
throw new Error('MISSING_PERMISSIONS', 'MANAGE_GUILD');
}
if (!applicationId || typeof applicationId !== 'string') throw new TypeError('INVALID_APPLICATION_ID');
// Check permission
await this.client.api.oauth2.authorize.post({
query: {
client_id: applicationId,
scope: 'applications.commands',
},
data: {
guild_id: this.id,
permissions: '0',
authorize: true,
},
});
}
addBot() {
console.log('Test only (Addbot)');
}
toJSON() {
const json = super.toJSON({
available: false,