1.3.1 • Published 9 months ago
amtix-tax v1.3.1
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
1.3.1
9 months ago
1.3.0
9 months ago
1.2.9
9 months ago
1.2.8
10 months ago
1.2.7
10 months ago
1.2.6
10 months ago
1.2.5
10 months ago
1.2.4
10 months ago
1.2.3
10 months ago
1.2.2
10 months ago
1.2.1
10 months ago
1.2.0
10 months ago
1.1.9
10 months ago
1.1.8
10 months ago
1.1.7
10 months ago
1.1.6
10 months ago
1.1.5
10 months ago
1.1.4
10 months ago
1.1.3
10 months ago
1.1.2
10 months ago
1.1.1
10 months ago
1.1.0
10 months ago
1.0.9
10 months ago
1.0.8
10 months ago
1.0.7
10 months ago
1.0.6
10 months ago
1.0.5
10 months ago
1.0.4
10 months ago
1.0.3
10 months ago
1.0.2
10 months ago
1.0.1
10 months ago
1.0.0
10 months ago