chore: release v2.8.5

This commit is contained in:
March 7th
2022-10-21 18:53:09 +07:00
parent ed4375fd9d
commit e348c8e308
5 changed files with 18 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ module.exports = (client, packet) => {
*/
const channel = client.channels.cache.get(packet.d.channel_id);
if (!channel) return;
channel._recipients = channel._recipients.push(packet.d.user);
channel._recipients.push(packet.d.user);
const user = client.users._add(packet.d.user);
client.emit(Events.CHANNEL_RECIPIENT_ADD, channel, user);
};

View File

@@ -21,6 +21,7 @@ class SessionManager extends CachedManager {
.get()
.then(data => {
const allData = data.user_sessions;
this.cache.clear();
for (const session of allData) {
this._add(new Session(this.client, session), true, { id: session.id_hash });
}

View File

@@ -426,6 +426,19 @@ class TextBasedChannel {
* channel.sendSlash('123456789012345678', 'embed title', 'description', 'author', '#00ff00')
*/
async sendSlash(bot, commandString, ...args) {
const perms = this.permissionsFor(this.client.user);
if (!perms.has('SEND_MESSAGES')) {
throw new Error(
'INTERACTION_SEND_FAILURE',
`Cannot send Slash to ${this.toString()} due to missing SEND_MESSAGES permission`,
);
}
if (!perms.has('USE_APPLICATION_COMMANDS')) {
throw new Error(
'INTERACTION_SEND_FAILURE',
`Cannot send Slash to ${this.toString()} due to missing USE_APPLICATION_COMMANDS permission`,
);
}
args = args.flat(2);
const cmd = commandString.trim().split(' ');
// Validate CommandName