nyx

The first CODM discrod bot -- cath.exe Template
git clone https://codeberg.org/night0721/nyx
Log | Files | Refs | LICENSE

commit 7d986ffdef356928a27b389625feec11d484c9db
parent 9c2256a9dab765eafaec219abee344dade8fbb1c
Author: night0721 <[email protected]>
Date:   Tue,  1 Feb 2022 03:13:11 +0800

economy

Diffstat:
Mcommand/Owner/add.js | 75++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
Dcommand/Owner/rmv.js | 31-------------------------------
2 files changed, 56 insertions(+), 50 deletions(-)

diff --git a/command/Owner/add.js b/command/Owner/add.js @@ -1,31 +1,68 @@ module.exports = { - name: "add", + name: "economy", category: "Owner", - usage: "(Number)", - description: "Add coins from someone", + description: "Add/Remove coins from someone", Owner: true, options: [ { - type: 6, - name: "user", - description: "The user you want to add", - required: true, + type: 1, + name: "add", + description: "Remove coins from someone", + options: [ + { + type: 6, + name: "user", + description: "The user you want to add", + required: true, + }, + { + type: 4, + name: "cp", + description: "The amount of CP you want to add", + required: true, + }, + ], }, { - type: 4, - name: "cp", - description: "The amount of CP you want to add", - required: true, + type: 1, + name: "rmv", + description: "Remove coins from someone", + options: [ + { + type: 6, + name: "user", + description: "The user you want to remove", + required: true, + }, + { + type: 4, + name: "cp", + description: "The amount of CP you want to remove", + required: true, + }, + ], }, ], run: async (client, interaction, args) => { - await client.add(args[0], args[1], interaction); - interaction.followUp({ - content: `<a:nyx_checkmark:897240322411724841> Successfully added **${interaction.options.getInteger( - "cp" - )}** ${client.currency} in **${ - interaction.options.getUser("user").username - }**'s balance`, - }); + if (args[0] === "add") { + await client.add(args[0], args[1], interaction); + interaction.followUp({ + content: `<a:nyx_checkmark:897240322411724841> Successfully added **${interaction.options.getInteger( + "cp" + )}** ${client.currency} in **${ + interaction.options.getUser("user").username + }**'s balance`, + }); + } + if (args[0] === "rmv") { + await client.rmv(args[0], args[1]); + interaction.followUp({ + content: `<a:nyx_checkmark:897240322411724841> Successfully removed **${interaction.options.getInteger( + "cp" + )}** ${client.currency} from **${ + interaction.options.getUser("user").username + }**'s balance`, + }); + } }, }; diff --git a/command/Owner/rmv.js b/command/Owner/rmv.js @@ -1,31 +0,0 @@ -module.exports = { - name: "rmv", - category: "Owner", - usage: "(Number)", - description: "Remove coins from someone", - Owner: true, - options: [ - { - type: 6, - name: "user", - description: "The user you want to remove", - required: true, - }, - { - type: 4, - name: "cp", - description: "The amount of CP you want to remove", - required: true, - }, - ], - run: async (client, interaction, args) => { - await client.rmv(args[0], args[1]); - interaction.followUp({ - content: `<a:nyx_checkmark:897240322411724841> Successfully removed **${interaction.options.getInteger( - "cp" - )}** ${client.currency} from **${ - interaction.options.getUser("user").username - }**'s balance`, - }); - }, -};