Quellcode durchsuchen

Fix caption query

ghorsington vor 5 Jahren
Ursprung
Commit
fbd0c8f239
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      bot/src/commands/facemorph.ts

+ 5 - 2
bot/src/commands/facemorph.ts

@@ -69,7 +69,7 @@ async function getRandomCaption(type: FaceCaptionType) {
 
     let caption = await repo.query(`select message
                                     from face_caption_message
-                                    where type = ?
+                                    where type = $1
                                     order by random()
                                     limit 1`, [ type ]) as FaceCaptionMessage[];
     if(caption.length == 0)
@@ -271,12 +271,15 @@ export default {
         else
             processor = morphFaces;
 
+        let replyEmoji = client.emojis.get("505076258753740810");
+        let emojiText = replyEmoji ? replyEmoji.toString() : "Jiiii~";
+
         processFaceSwap(
             msg,
             image.url,
             processor,
             `${msg.author.toString()} Nice image! I don't see anything interesting, though.`,
-            `${msg.author.toString()} ${client.emojis.get("505076258753740810").toString()}`
+            `${msg.author.toString()} ${emojiText}`
         ).catch(err => console.log(`Failed to run faceapp because ${err}`));
 
         return true;