Deivu / Idiotic-Wrapper

This is an NPM module to make easy use of the Idiot's Guide Canvas API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

This is an NPM module to make easy use of the Idiot's Guide Canvas API.

License:Apache License 2.0


Languages

Language:JavaScript 100.0%