tmath
v3.0.3
Published
Add an advanced customizable calculator to your discordbot! :D
Downloads
56
Maintainers
Readme
Installation
Requirements to use this package:
- Discord.JS v14
$ npm i tmath
$ npm i discord.js
Usage
This is an customizable calculator for a discordbot
const TMath = require("tmath");
const calculator = new TMath({
destroy: "Oh no, you locked me! :0", // Optional, default is "Calculator Locked"
invalid: "Next time just in a valid calculation! o.o", // Optional, default is "Invalid Calculation"
notOwner: "Hey, use your own calculator! c.c", // Optional, default is "Only the author can use the calculator! Run the command to create you're own."
deactivateMessage: "Well, just got deactivated :x", // Optional, default is "The Calculator got deactivated"
deactivateTimeout: "11m", // optional, default are 10 minutes
request: interaction, // A Interaction or Message
user: interaction.user // Required, the user who called the request
});
// Replying with the calculator setup
const reply = calculator.getReply();
const message = await interaction.reply(reply); // or channel.send, message.reply, etc
// Handling the calculations
calculator.handle(message);