Преглед на файлове

Fix compile error on TS 3.7

horse преди 5 години
родител
ревизия
91308940d8
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 3 3
      bot/src/commands/guide.ts
  2. 1 1
      bot/src/lowdb_migrator.ts

+ 3 - 3
bot/src/commands/guide.ts

@@ -98,8 +98,8 @@ export class GuideCommands {
             );
             return;
         }
-
-        if (!Object.values(GuideType).includes(type)) {
+        
+        if (!(<string[]>Object.values(GuideType)).includes(type)) {
             msg.channel.send(
                 `${msg.author.toString()} The type ${type} is not a valid guide type!`
             );
@@ -172,7 +172,7 @@ export class GuideCommands {
         let type = match[1];
         let keywords = match[2].toLowerCase().split(" ").map(s => s.trim()).filter(s => s.length != 0);
 
-        if (!Object.values(GuideType).includes(type)) {
+        if (!(<string[]>Object.values(GuideType)).includes(type)) {
             await msg.channel.send(
                 `${msg.author.toString()} The type ${type} is not a valid guide type!`
             );

+ 1 - 1
bot/src/lowdb_migrator.ts

@@ -71,7 +71,7 @@ async function migrateEmotes(db: IOldDatabase) {
     let repo = getRepository(ReactionEmote);
 
     for (const emoteType in db.emotes) {
-        if(!Object.values(ReactionType).includes(emoteType)) {
+        if(!(<string[]>Object.values(ReactionType)).includes(emoteType)) {
             console.log(`WARN: emote type ${emoteType} is not a predefined emote type!`)
             continue;
         }