Creates a prefix command `!fancy` that reposts a message with a new fancy font. Update it to use any font you like!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const event = context.params.event
// Update as needed
const command = '!fancy '
const newLetters = {
'a': '๐',
'b': '๐',
'c': '๐',
'd': '๐',
'e': '๐',
'f': '๐',
'g': '๐',
'h': '๐',
'i': '๐',
'j': '๐',
'k': '๐',
'l': '๐',
'm': '๐',
'n': '๐',
'o': '๐',
'p': '๐',
'q': '๐',
'r': '๐',
's': '๐',
't': '๐',
'u': '๐',
'v': '๐',
'w': '๐',
'x': '๐',
'y': '๐',
'z': '๐',
'A': '๐ฌ',
'B': '๐ญ',
'C': '๐ฎ',
'D': '๐ฏ',
'E': '๐ฐ',
'F': '๐ฑ',
'G': '๐ฒ',
'H': '๐ณ',
'I': '๐ด',
'J': '๐ต',
'K': '๐ถ',
'L': '๐ท',
'M': '๐ธ',
'N': '๐น',
'O': '๐บ',
'P': '๐ป',
'Q': '๐ผ',
'R': '๐ฝ',
'S': '๐พ',
'T': '๐ฟ',
'U': '๐',
'V': '๐',
'W': '๐',
'X': '๐',
'Y': '๐',
'Z': '๐
',
'1': 'โ ',
'2': 'โก',
'3': 'โข',
'4': 'โฃ',
'5': 'โค',
'6': 'โฅ',
'7': 'โฆ',
'8': 'โง',
'9': 'โจ',
'0': 'โช',
}
if (!event.content.startsWith(command)) return
const content = event.content.replace(command, '')
const newContent = content.split('').map(l => newLetters[l] || l).join('')
// Post the changed message
await lib.discord.channels['@0.1.2'].messages.create({
channel_id: event.channel_id,
content: newContent,
});
// Delete the original
await lib.discord.channels['@0.1.2'].messages.destroy({
channel_id: event.channel_id,
message_id: event.id,
});