Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

idiotic-api

YorkAARGH59Apache-2.00.2.11TypeScript support: included

An API wrapper for the private Idiot's Guide API

readme

Idiotic API

Discord

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:

Achievement Get!, used the api!

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:

POW

Wanted

await message.channel.send(new MessageAttachment(
  await client.API.wanted(message.author.displayAvatarURL({ format: "png", size: 128 })),
  "wanted.png"));

Example:

Dead or alive

pls

await message.channel.send(new MessageAttachment(
  await client.API.pls((message.mentions.members.first() || message.member).displayName),
  "pls.png"));

Example:

York pls

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:

Example welcome image