Merge pull request #1251 from 002-sans/main

chore: Some random updates
This commit is contained in:
Elysia
2024-08-23 03:24:51 +07:00
committed by GitHub
4 changed files with 5 additions and 10 deletions

View File

@@ -64,6 +64,7 @@
"qrcode": "^1.5.3",
"tough-cookie": "^4.1.4",
"tree-kill": "^1.2.2",
"tweetnacl": "^1.0.3",
"ws": "^8.16.0"
},
"engines": {

View File

@@ -128,7 +128,7 @@ class ChannelManager extends CachedManager {
recipients = recipients
.map(r => this.client.users.resolveId(r))
.filter(r => r && this.client.relationships.cache.get(r) == RelationshipTypes.FRIEND);
if (recipients.length > 9) throw new Error('Invalid Users length (max=9)');
if (recipients.length == 1 || recipients.length > 9) throw new Error('Invalid Users length (max=9)');
const data = await this.client.api.users['@me'].channels.post({
data: { recipients },
});

View File

@@ -1170,13 +1170,7 @@ class Message extends Base {
return this.client.api.channels[this.channelId].messages[this.id].ack.post({
data: {
manual: true,
mention_count:
this.mentions.everyone ||
this.mentions.repliedUser?.id === this.client.user.id ||
this.mentions.users.has(this.client.user.id) ||
(this.guildId && this.mentions.roles.some(r => this.guild.members.me._roles?.includes(r.id)))
? 1
: 0,
mention_count: 1,
},
});
}

View File

@@ -650,7 +650,7 @@ class CustomStatus extends Activity {
constructor(client, data = {}) {
if (!client) throw new Error("Class constructor CustomStatus cannot be invoked without 'client'");
super('presence' in client ? client.presence : client, {
name: 'Custom Status',
name: ' ',
type: ActivityTypes.CUSTOM,
...data,
});