From 2553883571bd6a67a94b3157eea9aeb3cf54d07b Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 10 Jul 2023 20:03:32 +0200 Subject: [PATCH] suits etzala --- src/index.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.mjs b/src/index.mjs index f6c0268..e4f7bb5 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -4,7 +4,7 @@ import cfg from '../config.json' assert { type: 'json' }; const bot = await new cuffeo(cfg.clients); -const g_cards = { "♠": "S", "♣": "C", "♦": "D", "♥": "H" }; +const g_suits = { "♠": "S", "♣": "C", "♦": "D", "♥": "H" }; const stripColors = msg => msg.replace(/\x03\d{0,2}(,\d{0,2}|\x02\x02)?/g, ''); @@ -12,9 +12,9 @@ const parseCards = msg => { const output = []; for(const c of stripColors(msg).match(/(\w+)([♠♣️♦♥️️])/g)) { if(c.length === 3) - output.push(`T${g_cards[c[2]]}`); + output.push(`T${g_suits[c[2]]}`); else - output.push(`${c[0]}${g_cards[c[1]]}`); + output.push(`${c[0]}${g_suits[c[1]]}`); } return output; };