Explorar o código

fix some stuff

Markus-Rost %!s(int64=3) %!d(string=hai) anos
pai
achega
14d4c839f3
Modificáronse 5 ficheiros con 25 adicións e 22 borrados
  1. 1 1
      RcGcDb
  2. 0 1
      bot.js
  3. 19 18
      dashboard/util.js
  4. 4 1
      main.js
  5. 1 1
      util/functions.js

+ 1 - 1
RcGcDb

@@ -1 +1 @@
-Subproject commit 4a272eb8c97994e546deb204eb62721cd05625aa
+Subproject commit 90e60ba66fda9e93bd0e9a55b7a188699fc84ce3

+ 0 - 1
bot.js

@@ -12,7 +12,6 @@ global.voice = {};
 const db = require('./util/database.js');
 const db = require('./util/database.js');
 
 
 const Discord = require('discord.js');
 const Discord = require('discord.js');
-if ( !Discord.Permissions.FLAGS.SEND_MESSAGES_IN_THREADS ) Discord.Permissions.FLAGS.SEND_MESSAGES_IN_THREADS = Discord.Permissions.FLAGS.SEND_MESSAGES;
 const client = new Discord.Client( {
 const client = new Discord.Client( {
 	makeCache: Discord.Options.cacheWithLimits( {
 	makeCache: Discord.Options.cacheWithLimits( {
 		MessageManager: {
 		MessageManager: {

+ 19 - 18
dashboard/util.js

@@ -406,31 +406,32 @@ function escapeText(text) {
 }
 }
 
 
 const permissions = {
 const permissions = {
-	ADMINISTRATOR: 1 << 3,
-	MANAGE_CHANNELS: 1 << 4,
-	MANAGE_GUILD: 1 << 5,
-	ADD_REACTIONS: 1 << 6,
-	VIEW_CHANNEL: 1 << 10,
-	SEND_MESSAGES: 1 << 11,
-	MANAGE_MESSAGES: 1 << 13,
-	EMBED_LINKS: 1 << 14,
-	ATTACH_FILES: 1 << 15,
-	READ_MESSAGE_HISTORY: 1 << 16,
-	MENTION_EVERYONE: 1 << 17,
-	USE_EXTERNAL_EMOJIS: 1 << 18,
-	MANAGE_NICKNAMES: 1 << 27,
-	MANAGE_ROLES: 1 << 28,
-	MANAGE_WEBHOOKS: 1 << 29,
-	SEND_MESSAGES_IN_THREADS: 1 << 64
+	ADMINISTRATOR: 1n << 3n,
+	MANAGE_CHANNELS: 1n << 4n,
+	MANAGE_GUILD: 1n << 5n,
+	ADD_REACTIONS: 1n << 6n,
+	VIEW_CHANNEL: 1n << 10n,
+	SEND_MESSAGES: 1n << 11n,
+	MANAGE_MESSAGES: 1n << 13n,
+	EMBED_LINKS: 1n << 14n,
+	ATTACH_FILES: 1n << 15n,
+	READ_MESSAGE_HISTORY: 1n << 16n,
+	MENTION_EVERYONE: 1n << 17n,
+	USE_EXTERNAL_EMOJIS: 1n << 18n,
+	MANAGE_NICKNAMES: 1n << 27n,
+	MANAGE_ROLES: 1n << 28n,
+	MANAGE_WEBHOOKS: 1n << 29n,
+	SEND_MESSAGES_IN_THREADS: 1n << 38n
 }
 }
 
 
 /**
 /**
  * Check if a permission is included in the BitField
  * Check if a permission is included in the BitField
- * @param {String|Number} all - BitField of multiple permissions
+ * @param {String|Number|BigInt} all - BitField of multiple permissions
  * @param {String[]} permission - Name of the permission to check for
  * @param {String[]} permission - Name of the permission to check for
  * @returns {Boolean}
  * @returns {Boolean}
  */
  */
-function hasPerm(all = 0, ...permission) {
+function hasPerm(all = 0n, ...permission) {
+	all = BitInt(all);
 	if ( (all & permissions.ADMINISTRATOR) === permissions.ADMINISTRATOR ) return true;
 	if ( (all & permissions.ADMINISTRATOR) === permissions.ADMINISTRATOR ) return true;
 	return permission.every( perm => {
 	return permission.every( perm => {
 		let bit = permissions[perm];
 		let bit = permissions[perm];

+ 4 - 1
main.js

@@ -66,7 +66,10 @@ manager.on( 'shardCreate', shard => {
 	} );
 	} );
 } );
 } );
 
 
-manager.spawn({timeout: 60000}).then( shards => {
+manager.spawn( {
+	delay: 0,
+	timeout: 60000
+} ).then( shards => {
 	if ( !isDebug && process.env.botlist ) {
 	if ( !isDebug && process.env.botlist ) {
 		var botList = JSON.parse(process.env.botlist);
 		var botList = JSON.parse(process.env.botlist);
 		for ( let [key, value] of Object.entries(botList) ) {
 		for ( let [key, value] of Object.entries(botList) ) {

+ 1 - 1
util/functions.js

@@ -222,7 +222,7 @@ function htmlToDiscord(html, pagelink = '', ...escapeArgs) {
 					syntaxhighlight = ( classes.find( syntax => syntax.startsWith( 'mw-highlight-lang-' ) )?.replace( 'mw-highlight-lang-', '' ) || '' );
 					syntaxhighlight = ( classes.find( syntax => syntax.startsWith( 'mw-highlight-lang-' ) )?.replace( 'mw-highlight-lang-', '' ) || '' );
 				}
 				}
 			}
 			}
-			if ( tagname === 'b' ) text += '**';
+			if ( tagname === 'b' || tagname === 'strong' ) text += '**';
 			if ( tagname === 'i' ) text += '*';
 			if ( tagname === 'i' ) text += '*';
 			if ( tagname === 's' ) text += '~~';
 			if ( tagname === 's' ) text += '~~';
 			if ( tagname === 'u' ) text += '__';
 			if ( tagname === 'u' ) text += '__';