suits etzala
This commit is contained in:
parent
27cca680bc
commit
2553883571
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user