Give the bot a number from 1 to 13, and it will generate ascii art using the Fibonaccii sequence. The first line will be 1 character long, the second will also be 1, the third will be 2, the fourth will be 3, then 5, 8, etc.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let prev = 0;
let n = ['i'];
let x = 1;
let num = context.params.event.content.split(' ').slice(1);
if (context.params.event.content.startsWith('-arc')) {
if (num <= 13) {
for (let i = 1; i < num; i++) {
n[i] = 'i'.repeat(x + prev);
let sum = x + prev;
prev = x;
x = sum;
}
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: n.join(`\n`),
});
} else {
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: 'The number of lines must be maximum 13.',
});
}
}