Superhero and Supervillain name generator with !hero and !villain.
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const supervillains = require('supervillains');
const superheroes = require('superheroes');
let msg = context.params.event.content;
let villain = supervillains.random();
let superhero = superheroes.random();
if (context.params.event.content.startsWith('!villain')) {
return await lib.discord.channels['@0.0.6'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
title: ``,
description: villain,
color: 0x811112,
},
});
}
if (context.params.event.content.startsWith('!hero')) {
return await lib.discord.channels['@0.0.6'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
embed: {
title: ``,
description: superhero,
color: 0x354065,
},
});
}