djs-selfbot-v13 3.7.22 → 3.7.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "djs-selfbot-v13",
3
- "version": "3.7.22",
3
+ "version": "3.7.23",
4
4
  "description": "An unofficial discord.js fork for creating selfbots",
5
5
  "main": "./src/index.js",
6
6
  "types": "./typings/index.d.ts",
@@ -606,6 +606,15 @@ class Message extends Base {
606
606
  * @readonly
607
607
  */
608
608
  get editable() {
609
+ const permissions = this.channel?.permissionsFor(this.client.user);
610
+ if (!permissions) return false;
611
+
612
+ const hasPermission = this.channel?.isThread?.()
613
+ ? permissions.has(Permissions.FLAGS.SEND_MESSAGES_IN_THREADS, false)
614
+ : permissions.has(Permissions.FLAGS.SEND_MESSAGES, false);
615
+
616
+ if (!hasPermission) return false;
617
+
609
618
  const precheck = Boolean(
610
619
  this.author.id === this.client.user.id &&
611
620
  !deletedMessages.has(this) &&
@@ -618,7 +627,6 @@ class Message extends Base {
618
627
  if (this.channel?.isThread()) {
619
628
  if (this.channel.archived) return false;
620
629
  if (this.channel.locked) {
621
- const permissions = this.channel.permissionsFor(this.client.user);
622
630
  if (!permissions?.has(Permissions.FLAGS.MANAGE_THREADS, true)) return false;
623
631
  }
624
632
  }
@@ -172,6 +172,16 @@ class MessagePayload {
172
172
  allowedMentions = Util.cloneObject(allowedMentions);
173
173
  allowedMentions.replied_user = allowedMentions.repliedUser;
174
174
  delete allowedMentions.repliedUser;
175
+
176
+ const guild = this.target.guild ?? this.target.channel?.guild;
177
+ if (guild && !this.isWebhook) {
178
+ const permissions = this.target.channel?.permissionsFor(this.target.client.user);
179
+ if (permissions) {
180
+ if (allowedMentions.parse?.includes('everyone') && !permissions.has(Permissions.FLAGS.MENTION_EVERYONE, false)) {
181
+ allowedMentions.parse = allowedMentions.parse.filter(p => p !== 'everyone');
182
+ }
183
+ }
184
+ }
175
185
  }
176
186
 
177
187
  let message_reference;