All Examples are based on Discord.js version 12, to back port it just remove ({ format: "ABC", size: XYZ })
from all avatar URL lines.
You'll want to declare this somewhere central, so maybe attach it to the client.
const Idiot = require("idiotic-api");
client.API = new Idiot.Client("your-token-here");
If you want to use the developer endpoint, you'll need to add { dev: true }
to your new Idiot Client like so.
client.API = new Idiot.Client("your-token-here", { dev: true });
Command Based Endpoints
Achievement
await message.channel.send(new MessageAttachment(
await client.API.achievement(message.author.displayAvatarURL({ format: "png", size: 32 }), args.join(" ")),
"achievement.png"));
Example:
Bat Slap
await message.channel.send(new MessageAttachment(
await client.API.batSlap(message.author.displayAvatarURL({ format: "png", size: 128 }),
message.mentions.users.first().displayAvatarURL({ format: "png", size: 128 })),
"batslap.png"));
Example:
Wanted
await message.channel.send(new MessageAttachment(
await client.API.wanted(message.author.displayAvatarURL({ format: "png", size: 128 })),
"wanted.png"));
Example:
pls
await message.channel.send(new MessageAttachment(
await client.API.pls((message.mentions.members.first() || message.member).displayName),
"pls.png"));
Example:
Greeting/Farewell Based Endpoints
Anime Welcome Placed inside your GuildMemberAdd event
await client.API.welcome("anime", member.user.bot, member.user.displayAvatarURL({ format: "png", size: 128 }), member.user.tag,`${member.guild.name}#${member.guild.memberCount}`);
Example: