22 lines
635 B
JavaScript
22 lines
635 B
JavaScript
const mapping = '¡"#$%⅋,)(*+\'-˙/0ƖᄅƐㄣϛ9ㄥ86:;<=>?@∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Z[/]^_`ɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz{|}~';
|
||
// Start with the character '!'
|
||
const OFFSET = '!'.charCodeAt(0);
|
||
|
||
exports.run = (bot, msg, args) => {
|
||
if (args.length < 1) {
|
||
throw 'You must provide text to flip!';
|
||
}
|
||
|
||
msg.edit(
|
||
args.join(' ').split('')
|
||
.map(c => c.charCodeAt(0) - OFFSET)
|
||
.map(c => mapping[c] || ' ')
|
||
.reverse().join('')
|
||
);
|
||
};
|
||
|
||
exports.info = {
|
||
name: 'fliptext',
|
||
usage: 'fliptext <text>',
|
||
description: 'Flips your text!'
|
||
};
|