amtix-tax
v1.3.1
Published
probot tax by amtixdev
Downloads
78
Maintainers
Readme
Examples/How Package AmtiX-Tax Work?
How To Install Package?
npm install amtix-tax
Example How Package Work For Discord.js Version v12?
// Discord Package
const Discord = require('discord.js');
const client = new Discord.Client();
// AmtiX-Tax Package
const amtixtax = require('amtix-tax');
// Bot Prefix
const prefix = "Your Bot Prefix Here";
// Code
client.on("message", message => {
if(message.content.startsWith(prefix + "tax")) {
let amount = message.content.split(" ").slice(1).join(" ");
if(!amount) return message.channel.send("Amount Cannot Be Empty")
let taxs = amtixtax.tax(amount,true) // true will accept amount like this 1.7m or 100k
if(!taxs)return message.channel.send("**Put A Valid Number**")
const embed = new Discord.MessageEmbed()
.addField("**The bot will take**",`**${taxs.difference}**`)
.addField("**The amount you need to transfer**",`**${taxs.tax}**`)
message.channel.send(embed);
}});
// Client Login
client.login("your token here");
Example How Package Work For Discord.js Version v13/v14?
// Discord Package
const { Client, ActionRowBuilder, ButtonBuilder, ButtonStyle, Message, MessageEmbed } = require('discord.js');
const client = new Client({
intents: 131071, // Intents Calculator : https://ziad87.net/intents/
partials: ['CHANNEL'],
});
// AmtiX-Tax Package
const amtixtax = require('amtix-tax');
// Bot Prefix
const prefix = "Your Bot Prefix Here";
// Code
client.on("messageCreate", message => {
if(message.content.startsWith(prefix + "tax")) {
let amount = message.content.split(" ").slice(1).join(" ");
if(!amount) return message.channel.send("Amount Cannot Be Empty")
let taxs = amtixtax.tax(amount,true) // true will accept amount like this 1.7m or 100k
if(!taxs)return message.channel.send("**Put A Valid Number**")
var embed = new Discord.MessageEmbed()
.setTitle("Probot Tax")
.addField("**The bot will take**",`**${taxs.difference}**`)
.addField("**The amount you need to transfer**",`**${taxs.tax}**`)
message.channel.send({embeds: [embed]});
}});
// Client Login
client.login("your token here");
Example How Package Work For Discord.js Version v13 Handler?
const { MessageEmbed, Permissions } = require("discord.js");
const amtixtax = require('amtix-tax');
module.exports = {
name: 'tax',
desription: 'Probot tax',
permission: ["SEND_MESSAGES"],
async execute(client, message, args){
let amount = message.content.split(" ").slice(1).join(" ");
if(!amount) return message.channel.send("Amount cannot be empty")
let taxs = amtixtax.tax(amount,true) // true will accept amount like this 1.7m or 100k
if(!taxs)return message.channel.send("Put a valid number")
const taxembed = new MessageEmbed()
.addField("- **The bot will take**",`**${taxs.difference}**`)
.addField("- **The amount you need to transfer**",`**${taxs.tax}**`)
.setFooter(`${client.user.username}`, `${client.user.displayAvatarURL({dynamic: true})}`)
.setTimestamp()
await message.reply({embeds: [taxembed]})
}
}
By AmtiXDev
If You Need Help About How The Npm Package Work? Contant Me HERE
CopyRight ©
All rights reserved to AmtiXDev