0.0.3 âĸ Published 1 year ago
weky-slash v0.0.3
What is weky?
- A fun npm package to play games within Discord with buttons!
- looking for examples? click here: Examples
- ATENTION! This package is a fork from 'weky' and it does not work as the original one.
Features
- đ§ Beginner friendly
- đ Easy to use
- ⨠Simple
- đ Discord Buttons
- đģ Supports Slash Commands
- đ¤ Supports Discord.JS V13
- and much more!
Install the package đĨ
npm install weky-slash
Usage đ
const { Calculator } = require("weky-slash");
await Calculator({
message: message,
embed: {
title: 'Calculator | Weky Development',
color: '#5865F2',
footer: 'Šī¸ Weky Development',
timestamp: true
},
disabledQuery: 'Calculator is disabled!',
invalidQuery: 'The provided equation is invalid!',
othersMessage: 'Only <@{{author}}> can use the buttons!'
});
Example âī¸
Discord.js v13
const Discord = require('discord.js');
const client = new Discord.Client();
const { Calculator } = require('weky-slash');
client.on('ready', async () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('messageCreate', async (message) => {
if (message.content === '!calculator') {
await Calculator({
message: message,
embed: {
title: 'Calculator | Weky Development',
color: '#5865F2',
footer: 'Šī¸ Weky Development',
timestamp: true,
},
disabledQuery: 'Calculator is disabled!',
invalidQuery: 'The provided equation is invalid!',
othersMessage: 'Only <@{{author}}> can use the buttons!',
});
}
});
client.login('DISCORD_BOT_TOKEN');
Discord.js v13 (Slash Commands)
const Discord = require('discord.js');
const client = new Discord.Client();
const { Calculator } = require('weky-slash');
client.on('ready', async () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('interactionCreate', async (interaction) => {
if (interaction.commandName === 'calculator') {
interaction.deferReply() // Optional
await Calculator({
message: interaction,
slash: true,
embed: {
title: 'Calculator | Weky Development',
color: '#5865F2',
footer: 'Šī¸ Weky Development',
timestamp: true,
},
disabledQuery: 'Calculator is disabled!',
invalidQuery: 'The provided equation is invalid!',
othersMessage: 'Only <@{{author}}> can use the buttons!',
});
}
});
client.login('DISCORD_BOT_TOKEN');
Result đ¤
Contributing đ¤
- Contributions, issues and feature requests are welcome!
- Feel free to check issues page.
Developers đ¨âđģ
- Face#5454
- Sujal Goel#7602
- rayz#4986
- bluey#0012 (Slash Commands Support)