Calculator for Discord.js with buttons https://www.npmjs.com/package/tmath
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Adam Brangenberg 0c9f1231a1 publishing patches 2 months ago
.idea finished transferring logic 2 months ago
.gitignore finished to add buttons into dataset 4 months ago
LICENSE Initial commit 1 year ago
README.md Added example image in readme 2 months ago
dataset.js fixed delete button 2 months ago
index.js fixed message not registering 2 months ago
package.json publishing patches 2 months ago

README.md

NPM Info

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);

Example

Example to the Calculator

v3.0.1 v14 Support


For support DM me on Discord (Adam ^^#7729), Support server: Coming Soon