README
@nekoyasui/test
A basic API for configuring and improving the ways you code your Discord bot. It is integrated with discord.js v12, but it can also work with older versions. This API has a wide range of applications.
How to use 📚
const nekoyasui = require("@nekoyasuii/test"); // Requiring our package.
//timeout
const msg = await message.channel.send("ohayoo!");
timeout(message, msg, 5000);
//search
exports.run = async (client, message, args) => {
const Method = args[0] ? args[0].toLowerCase() : "";
switch (Method) {
case "search":
const Option = args[1] ? args[1].toLowerCase() : "";
switch (Option) {
case "member":
const member = await nekoyasui.search.member(message, args[2], { current: true });
console.log(member);
return message.channel.send(member.user.id);
case "user":
const user = await nekoyasui.search.user(message, args[2]);
console.log(user);
return message.channel.send(`${user.username}#${user.discriminator}`);
case "channel":
const channel = await nekoyasui.search.channel(message, args[2]);
console.log(channel);
return message.channel.send(channel.id);
case "role":
const role = await nekoyasui.search.role(message, args[2]);
if(!role) return;
console.log(role);
return message.channel.send(role.id);
case "emoji":
const emoji = await nekoyasui.search.emoji(message, args[2]);
console.log(emoji);
return message.channel.send(`<:${emoji.name}:${emoji.id}> \`\`<:${emoji.name}: ${emoji.id}>\`\``);
default:
return message.channel.send("wrong search option");
}
}
}