├── .env.example ├── .gitignore ├── LICENSE ├── README.md ├── commands ├── Blacklists │ ├── AddBlacklist.js │ ├── DeleteAllBlacklists.js │ └── DeleteBlacklist.js ├── Chats │ ├── AddChannel.js │ ├── DeleteChannel.js │ ├── EditChannel.js │ ├── MuteUser.js │ ├── PurgeChannelMessages.js │ └── UnMuteUser.js ├── Files │ ├── DeleteFile.js │ ├── DeleteFiles.js │ ├── EditFile.js │ ├── RetrieveFile.js │ └── UploadFile.js ├── Licenses │ ├── ActivateAnUser.js │ ├── AddLicense.js │ ├── AddTime.js │ ├── AssignLicense.js │ ├── BanLicense.js │ ├── DeleteAllLicenses.js │ ├── DeleteLicense.js │ ├── DeleteMultipleLicenses.js │ ├── DeleteUnusedLicenses.js │ ├── DeleteUsedLicenses.js │ ├── LicenseInfo.js │ ├── SetLicenseNote.js │ ├── UnbanLicense.js │ └── VerifyLicense.js ├── Logs │ └── DeleteAllLogs.js ├── ResellerAndManager │ ├── AddResellerBalance.js │ ├── CreateAccount.js │ ├── DeleteAccount.js │ └── GetResellerBalance.js ├── Sessions │ ├── KillAllSessions.js │ └── KillSession.js ├── Settings │ ├── AddApplication.js │ ├── FetchApplicationSettings.js │ ├── PauseApplication.js │ ├── RemoveApplication.js │ ├── SelectApplication.js │ ├── SetLicenseMask.js │ ├── SetLogging.js │ └── UnPauseApplication.js ├── Subscriptions │ ├── AddSubscription.js │ ├── CountSubscriptions.js │ ├── DeleteApplicationSubscription.js │ ├── EditApplicationSubscription.js │ ├── PauseApplicationSubscription.js │ └── UnPauseApplicationSubscription.js ├── Users │ ├── AddUser.js │ ├── AssignVariableToUser.js │ ├── BanUser.js │ ├── DeleteAllUsers.js │ ├── DeleteExpiredUsers.js │ ├── DeleteUser.js │ ├── DeleteUserSubscription.js │ ├── DeleteUserVariable.js │ ├── EditEmail.js │ ├── EditUsername.js │ ├── ExtendUser.js │ ├── FetchLicenseFromUser.js │ ├── PauseUser.js │ ├── ResetAllUsers.js │ ├── ResetPassword.js │ ├── ResetUser.js │ ├── RetrieveVariable.js │ ├── SetUserCooldown.js │ ├── Subtract.js │ ├── UnPauseUser.js │ ├── UnbanUser.js │ ├── UserData.js │ └── VerifyUser.js ├── Utilies │ ├── AddApplicationHash.js │ ├── AddHardwareId.js │ ├── Fetch.js │ ├── FetchApplicationStats.js │ ├── Help.js │ └── ResetApplicationHash.js ├── Variables │ ├── AddVariable.js │ ├── DeleteAllVariables.js │ ├── DeleteVariable.js │ ├── EditVariable.js │ ├── MassDeleteUserVariables.js │ └── RetrieveVariableByName.js ├── WebLoader │ ├── AddButton.js │ ├── DeleteAllButtons.js │ └── DeleteButton.js ├── Webhooks │ ├── CreateWebhook.js │ ├── DeleteAllWebhooks.js │ └── DeleteWebhook.js └── Whitelists │ ├── AddWhitelist.js │ ├── DeleteAllWhitelists.js │ └── DeleteWhitelist.js ├── index.js ├── package.json └── utils ├── config.js └── database.js /.env.example: -------------------------------------------------------------------------------- 1 | # To use this configuration type, remove the .example from the filename 2 | # You do not need to fill out the .env and the .json, just one of them 3 | 4 | TOKEN="" 5 | DEVELOPMENT_SERVER_ID="" 6 | TYPE="" 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Node.js basics 2 | node_modules/ 3 | package-lock.json 4 | 5 | # Ignore .env files 6 | .env 7 | 8 | # Ignore config.json files 9 | config.json 10 | 11 | # Ignore package-lock.json 12 | package-lock.json 13 | yarn.lock 14 | bun.lock 15 | bun.lockb 16 | deno.lock 17 | 18 | # Ignore json.sqlite 19 | json.sqlite 20 | 21 | # Ignore JetBrains IDE 22 | .idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Elastic License 2.0 2 | 3 | URL: https://www.elastic.co/licensing/elastic-license 4 | 5 | ## Acceptance 6 | 7 | By using the software, you agree to all of the terms and conditions below. 8 | 9 | ## Copyright License 10 | 11 | The licensor grants you a non-exclusive, royalty-free, worldwide, 12 | non-sublicensable, non-transferable license to use, copy, distribute, make 13 | available, and prepare derivative works of the software, in each case subject to 14 | the limitations and conditions below. 15 | 16 | ## Limitations 17 | 18 | You may not provide the software to third parties as a hosted or managed 19 | service, where the service provides users with access to any substantial set of 20 | the features or functionality of the software. 21 | 22 | You may not move, change, disable, or circumvent the license key functionality 23 | in the software, and you may not remove or obscure any functionality in the 24 | software that is protected by the license key. 25 | 26 | You may not alter, remove, or obscure any licensing, copyright, or other notices 27 | of the licensor in the software. Any use of the licensor’s trademarks is subject 28 | to applicable law. 29 | 30 | ## Patents 31 | 32 | The licensor grants you a license, under any patent claims the licensor can 33 | license, or becomes able to license, to make, have made, use, sell, offer for 34 | sale, import and have imported the software, in each case subject to the 35 | limitations and conditions in this license. This license does not cover any 36 | patent claims that you cause to be infringed by modifications or additions to 37 | the software. If you or your company make any written claim that the software 38 | infringes or contributes to infringement of any patent, your patent license for 39 | the software granted under these terms ends immediately. If your company makes 40 | such a claim, your patent license ends immediately for work on behalf of your 41 | company. 42 | 43 | ## Notices 44 | 45 | You must ensure that anyone who gets a copy of any part of the software from you 46 | also gets a copy of these terms. 47 | 48 | If you modify the software, you must include in any modified copies of the 49 | software prominent notices stating that you have modified the software. 50 | 51 | ## No Other Rights 52 | 53 | These terms do not imply any licenses other than those expressly granted in 54 | these terms. 55 | 56 | ## Termination 57 | 58 | If you use the software in violation of these terms, such use is not licensed, 59 | and your licenses will automatically terminate. If the licensor provides you 60 | with a notice of your violation, and you cease all violation of this license no 61 | later than 30 days after you receive that notice, your licenses will be 62 | reinstated retroactively. However, if you violate these terms after such 63 | reinstatement, any additional violation of these terms will cause your licenses 64 | to terminate automatically and permanently. 65 | 66 | ## No Liability 67 | 68 | *As far as the law allows, the software comes as is, without any warranty or 69 | condition, and the licensor will not be liable to you for any damages arising 70 | out of these terms or the use or nature of the software, under any kind of 71 | legal claim.* 72 | 73 | ## Definitions 74 | 75 | The **licensor** is the entity offering these terms, and the **software** is the 76 | software the licensor makes available under these terms, including any portion 77 | of it. 78 | 79 | **you** refers to the individual or entity agreeing to these terms. 80 | 81 | **your company** is any legal entity, sole proprietorship, or other kind of 82 | organization that you work for, plus all organizations that have control over, 83 | are under the control of, or are under common control with that 84 | organization. **control** means ownership of substantially all the assets of an 85 | entity, or the power to direct its management and policies by vote, contract, or 86 | otherwise. Control can be direct or indirect. 87 | 88 | **your licenses** are all the licenses granted to you for the software under 89 | these terms. 90 | 91 | **use** means anything you do with the software requiring one of your licenses. 92 | 93 | **trademark** means trademarks, service marks, and similar rights. 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KeyAuth-Discord-Bot-Source **2024** 2 | Source Code of Discord bot for https://keyauth.cc, Also if this bot doesn't work for you use https://github.com/KeyAuth/KeyAuth-Discord-Bot/tree/53a395e024834edcba56fe651ac031f4762e903f it is old bot. 3 | 4 | ## Installation 5 | Click here to see Installation Video! 8 | 9 | 10 | ``` 11 | 1. Install Source code. 12 | 2. Extract to folder of your choice. 13 | 3. Open the folder in code editor of your choice. 14 | 4. Edit .env.example > Rename file to: `.env`, fill in your config 15 | 5. Open CMD on that folder and run npm install 16 | 6. To start bot use `node .` or `node index.js` 17 | ``` 18 | ## Discord Developer Portal 19 | ``` 20 | 1. Go to Discord Developer Portal 21 | 2. Create application 22 | 3. Click on the "BOT" tab and add bot. 23 | 4. Go to OAuth2 Tab -> URL Generator 24 | 5. Add these Scopes: bot, application.commands 25 | 6. Add these Bot Permissions: Administrator, Then copy Generated URL and authorize it. 26 | 7. Add bot to server. 27 | 8. Type / in a channel to see bot's commands 28 | ``` 29 | 30 | ## **Bugs** 31 | 32 | If there's a problem with **running** the bot after following the instructions, please report a bug here https://keyauth.cc/app/?page=forms 33 | 34 | Do **not** submit a bug report if you're having issues installing NPM packages. That has nothing to do with KeyAuth and you'll need to Google/YouTube your instillation error(s) 35 | 36 | ## Copyright License 37 | 38 | KeyAuth is licensed under **Elastic License 2.0** 39 | 40 | * You may not provide the software to third parties as a hosted or managed 41 | service, where the service provides users with access to any substantial set of 42 | the features or functionality of the software. 43 | 44 | * You may not move, change, disable, or circumvent the license key functionality 45 | in the software, and you may not remove or obscure any functionality in the 46 | software that is protected by the license key. 47 | 48 | * You may not alter, remove, or obscure any licensing, copyright, or other notices 49 | of the licensor in the software. Any use of the licensor’s trademarks is subject 50 | to applicable law. 51 | 52 | Thank you for your compliance, we work hard on the development of KeyAuth and do not appreciate our copyright being infringed. 53 | 54 | ## Our Discord Bot is hosted on: 55 | https://www.oracle.com/cloud/free/ free forever, watch video for tutorial https://www.youtube.com/watch?v=90JbCrB3m3I 56 | 57 | **What is KeyAuth?** 58 | 59 | KeyAuth is an Open source authentication system with cloud hosting plans as well. Client SDKs available for [C#](https://github.com/KeyAuth/KeyAuth-CSHARP-Example), [C++](https://github.com/KeyAuth/KeyAuth-CPP-Example), [Python](https://github.com/KeyAuth/KeyAuth-Python-Example), [Java](https://github.com/KeyAuth-Archive/KeyAuth-JAVA-api), [JavaScript](https://github.com/mazkdevf/KeyAuth-JS-Example), [VB.NET](https://github.com/KeyAuth/KeyAuth-VB-Example), [PHP](https://github.com/KeyAuth/KeyAuth-PHP-Example), [Rust](https://github.com/KeyAuth/KeyAuth-Rust-Example), [Go](https://github.com/mazkdevf/KeyAuth-Go-Example), [Lua](https://github.com/mazkdevf/KeyAuth-Lua-Examples), [Ruby](https://github.com/mazkdevf/KeyAuth-Ruby-Example), and [Perl](https://github.com/mazkdevf/KeyAuth-Perl-Example). KeyAuth has several unique features such as memory streaming, webhook function where you can send requests to API without leaking the API, discord webhook notifications, ban the user securely through the application at your discretion. Feel free to join https://t.me/keyauth or https://keyauth.cc/discord if you have questions or suggestions. 60 | 61 | Looking for a Discord bot made by the KeyAuth & RestoreCord founder that you can use to backup your Discord members, server settings, and messages? Go to https://vaultcord.com 62 | -------------------------------------------------------------------------------- /commands/Blacklists/DeleteAllBlacklists.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-blacklists") 8 | .setDescription("Delete All Blacklists"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`); 14 | if (sellerkey === null) 15 | return interaction.editReply({ 16 | embeds: [ 17 | new EmbedBuilder() 18 | .setDescription( 19 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 20 | ) 21 | .setColor(Colors.Red) 22 | .setTimestamp(), 23 | ], 24 | ephemeral: ephemeral, 25 | }); 26 | 27 | fetch( 28 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delblacks`, 29 | ) 30 | .then((res) => res.json()) 31 | .then((json) => { 32 | if (json.success) { 33 | interaction.editReply({ 34 | embeds: [ 35 | new EmbedBuilder() 36 | .setTitle(json.message) 37 | .setColor(Colors.Blue) 38 | .setTimestamp(), 39 | ], 40 | ephemeral: ephemeral, 41 | }); 42 | } else { 43 | interaction.editReply({ 44 | embeds: [ 45 | new EmbedBuilder() 46 | .setTitle(json.message) 47 | .addFields([ 48 | { 49 | name: "Note:", 50 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-applcation\` command.`, 51 | }, 52 | ]) 53 | .setColor(Colors.Red) 54 | .setFooter({ text: "KeyAuth Discord Bot" }) 55 | .setTimestamp(), 56 | ], 57 | ephemeral: ephemeral, 58 | }); 59 | } 60 | }); 61 | }, 62 | }; 63 | -------------------------------------------------------------------------------- /commands/Blacklists/DeleteBlacklist.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-blacklist") 8 | .setDescription("Delete a blacklist") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete blacklist", 11 | "fi": "Poista musta lista", 12 | "fr": "Supprimer la liste noire", 13 | "de": "Schwarze Liste löschen", 14 | "it": "Elimina blacklist", 15 | "nl": "Verwijder zwarte lijst", 16 | "ru": "Удалить черный список", 17 | "pl": "Usuń czarną listę", 18 | "tr": "Kara listeyi sil", 19 | "cs": "Odstranit černou listinu", 20 | "ja": "ブラックリストを削除する", 21 | "ko": "블랙리스트 삭제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("data") 26 | .setDescription("Blacklist data here.") 27 | .setRequired(true) 28 | ) 29 | .addStringOption((option) => 30 | option 31 | .setName("blacktype") 32 | .setDescription("IP or HWID.") 33 | .setRequired(true) 34 | ), 35 | async execute(interaction) { 36 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 37 | let ephemeral = !interaction.guild ? false : true; 38 | 39 | let sellerkey = await db.get(`token_${idfrom}`) 40 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 41 | 42 | let data = interaction.options.getString("data") 43 | let blacktype = interaction.options.getString("blacktype") 44 | 45 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delblack&data=${data}&blacktype=${blacktype}`) 46 | .then(res => res.json()) 47 | .then(json => { 48 | if (json.success) { 49 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 50 | } else { 51 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 52 | } 53 | }) 54 | }, 55 | }; -------------------------------------------------------------------------------- /commands/Chats/DeleteChannel.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-channel") 8 | .setDescription("Delete chat channel") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete chat channel", 11 | fi: "Poista keskustelukanava", 12 | fr: "Supprimer le canal de discussion", 13 | de: "Chat-Kanal löschen", 14 | it: "Elimina canale di chat", 15 | nl: "Chatkanaal verwijderen", 16 | ru: "Удалить чат-канал", 17 | pl: "Usuń kanał czatu", 18 | tr: "Sohbet kanalını sil", 19 | cs: "Odstranit chatovací kanál", 20 | ja: "チャットチャネルを削除する", 21 | ko: "채팅 채널 삭제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("name") 26 | .setDescription("Chat channel name") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Chat channel name", 29 | fi: "Keskustelukanavan nimi", 30 | fr: "Nom du canal de discussion", 31 | de: "Name des Chat-Kanals", 32 | it: "Nome del canale di chat", 33 | nl: "Naam van chatkanaal", 34 | ru: "Имя чат-канала", 35 | pl: "Nazwa kanału czatu", 36 | tr: "Sohbet kanalı adı", 37 | cs: "Název chatovacího kanálu", 38 | ja: "チャットチャネル名", 39 | ko: "채팅 채널 이름", 40 | }) 41 | .setRequired(true), 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`); 48 | if (sellerkey === null) 49 | return interaction.editReply({ 50 | embeds: [ 51 | new EmbedBuilder() 52 | .setDescription( 53 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 54 | ) 55 | .setColor(Colors.Red) 56 | .setTimestamp(), 57 | ], 58 | ephemeral: ephemeral, 59 | }); 60 | let name = interaction.options.getString("name"); 61 | 62 | fetch( 63 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delchannel&name=${name}`, 64 | ) 65 | .then((res) => res.json()) 66 | .then((json) => { 67 | if (json.success) { 68 | interaction.editReply({ 69 | embeds: [ 70 | new EmbedBuilder() 71 | .setTitle(json.message) 72 | .setColor(Colors.Green) 73 | .setTimestamp(), 74 | ], 75 | ephemeral: ephemeral, 76 | }); 77 | } else { 78 | interaction.editReply({ 79 | embeds: [ 80 | new EmbedBuilder() 81 | .setTitle(json.message) 82 | .addFields([ 83 | { 84 | name: "Note:", 85 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 86 | }, 87 | ]) 88 | .setColor(Colors.Red) 89 | .setTimestamp() 90 | .setFooter({ text: "KeyAuth Discord Bot" }), 91 | ], 92 | ephemeral: ephemeral, 93 | }); 94 | } 95 | }); 96 | }, 97 | }; 98 | -------------------------------------------------------------------------------- /commands/Chats/EditChannel.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("edit-channel") 8 | .setDescription("Edit Channel") 9 | .addStringOption((option) => 10 | option 11 | .setName("name") 12 | .setDescription("The name of the channel you would like to edit.") 13 | .setRequired(true), 14 | ) 15 | .addIntegerOption((option) => 16 | option 17 | .setName("delay") 18 | .setDescription("The delay between messages.") 19 | .setRequired(true), 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`); 26 | if (sellerkey === null) 27 | return interaction.editReply({ 28 | embeds: [ 29 | new EmbedBuilder() 30 | .setDescription( 31 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 32 | ) 33 | .setColor(Colors.Red) 34 | .setTimestamp(), 35 | ], 36 | ephemeral: ephemeral, 37 | }); 38 | let name = interaction.options.getString("name"); 39 | let delay = interaction.options.getInteger("delay"); 40 | 41 | fetch( 42 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=editchan&name=${name}&delay=${delay}`, 43 | ) 44 | .then((res) => res.json()) 45 | .then((json) => { 46 | if (json.success) { 47 | interaction.editReply({ 48 | embeds: [ 49 | new EmbedBuilder() 50 | .setTitle(json.message) 51 | .setColor(Colors.Blue) 52 | .setTimestamp(), 53 | ], 54 | ephemeral: ephemeral, 55 | }); 56 | } else { 57 | interaction.editReply({ 58 | embeds: [ 59 | new EmbedBuilder() 60 | .setTitle(json.message) 61 | .addFields([ 62 | { 63 | name: "Note:", 64 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 65 | }, 66 | ]) 67 | .setColor(Colors.Red) 68 | .setFooter({ text: "KeyAuth Discord Bot" }) 69 | .setTimestamp(), 70 | ], 71 | ephemeral: ephemeral, 72 | }); 73 | } 74 | }); 75 | }, 76 | }; 77 | -------------------------------------------------------------------------------- /commands/Chats/PurgeChannelMessages.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("purge-chat") 8 | .setDescription("Purge chat channel's messages") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Purge chat channel's messages", 11 | fi: "Puhdista keskustelukanavan viestit", 12 | fr: "Purger les messages du canal de discussion", 13 | de: "Löschen Sie die Nachrichten des Chatkanals", 14 | it: "Elimina i messaggi del canale di chat", 15 | nl: "Verwijder de berichten van het chatkanaal", 16 | ru: "Удалить сообщения чат-канала", 17 | pl: "Wyczyść wiadomości kanału czatu", 18 | tr: "Sohbet kanalının mesajlarını temizle", 19 | cs: "Vymažte zprávy chatovacího kanálu", 20 | ja: "チャットチャネルのメッセージを削除する", 21 | ko: "채팅 채널의 메시지 삭제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("name") 26 | .setDescription("Chat channel name") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Chat channel name", 29 | fi: "Keskustelukanavan nimi", 30 | fr: "Nom du canal de discussion", 31 | de: "Name des Chatkanals", 32 | it: "Nome del canale di chat", 33 | nl: "Naam van het chatkanaal", 34 | ru: "Имя чат-канала", 35 | pl: "Nazwa kanału czatu", 36 | tr: "Sohbet kanalı adı", 37 | cs: "Název chatovacího kanálu", 38 | ja: "チャットチャネル名", 39 | ko: "채팅 채널 이름", 40 | }) 41 | .setRequired(true), 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`); 48 | if (sellerkey === null) 49 | return interaction.editReply({ 50 | embeds: [ 51 | new EmbedBuilder() 52 | .setDescription( 53 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 54 | ) 55 | .setColor(Colors.Red) 56 | .setTimestamp(), 57 | ], 58 | ephemeral: ephemeral, 59 | }); 60 | let name = interaction.options.getString("name"); 61 | 62 | fetch( 63 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=clearchannel&name=${name}`, 64 | ) 65 | .then((res) => res.json()) 66 | .then((json) => { 67 | if (json.success) { 68 | interaction.editReply({ 69 | embeds: [ 70 | new EmbedBuilder() 71 | .setTitle(json.message) 72 | .setColor(Colors.Green) 73 | .setTimestamp(), 74 | ], 75 | ephemeral: ephemeral, 76 | }); 77 | } else { 78 | interaction.editReply({ 79 | embeds: [ 80 | new EmbedBuilder() 81 | .setTitle(json.message) 82 | .addFields([ 83 | { 84 | name: "Note:", 85 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 86 | }, 87 | ]) 88 | .setColor(Colors.Red) 89 | .setTimestamp() 90 | .setFooter({ text: "KeyAuth Discord Bot" }), 91 | ], 92 | ephemeral: ephemeral, 93 | }); 94 | } 95 | }); 96 | }, 97 | }; 98 | -------------------------------------------------------------------------------- /commands/Chats/UnMuteUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("unmute-user") 8 | .setDescription("Unmute user from chat channel") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Unmute user from chat channel", 11 | fi: "Poista käyttäjän mykistys chat-kanavalta", 12 | fr: "Réactiver l'utilisateur du canal de chat", 13 | de: "Stummschaltung des Benutzers im Chat-Kanal aufheben", 14 | it: "Attiva l'audio dell'utente dal canale di chat", 15 | nl: "Dempen van gebruiker van chatkanaal opheffen", 16 | ru: "Включить пользователя из канала чата", 17 | pl: "Wyłącz wyciszenie użytkownika z kanału czatu", 18 | tr: "Kullanıcının sohbet kanalından sesini aç", 19 | cs: "Přestat ignorovat uživatele z chatovacího kanálu", 20 | ja: "チャット チャネルからユーザーのミュートを解除", 21 | ko: "채팅 채널에서 사용자 음소거 해제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("user") 26 | .setDescription("The user's username") 27 | .setDescriptionLocalizations({ 28 | "en-US": "The user's username", 29 | fi: "Käyttäjän käyttäjätunnus", 30 | fr: "Le nom d'utilisateur de l'utilisateur", 31 | de: "Der Benutzername des Benutzers", 32 | it: "Il nome utente dell'utente", 33 | nl: "De gebruikersnaam van de gebruiker", 34 | ru: "Имя пользователя пользователя", 35 | pl: "Nazwa użytkownika użytkownika", 36 | tr: "Kullanıcının kullanıcı adı", 37 | cs: "Uživatelské jméno uživatele", 38 | ja: "ユーザーのユーザー名", 39 | ko: "사용자의 사용자 이름", 40 | }) 41 | .setRequired(true), 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`); 48 | if (sellerkey === null) 49 | return interaction.editReply({ 50 | embeds: [ 51 | new EmbedBuilder() 52 | .setDescription( 53 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 54 | ) 55 | .setColor(Colors.Red) 56 | .setTimestamp(), 57 | ], 58 | ephemeral: ephemeral, 59 | }); 60 | let user = interaction.options.getString("user"); 61 | 62 | fetch( 63 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=unmuteuser&user=${user}`, 64 | ) 65 | .then((res) => res.json()) 66 | .then((json) => { 67 | if (json.success) { 68 | interaction.editReply({ 69 | embeds: [ 70 | new EmbedBuilder() 71 | .setTitle(json.message) 72 | .setColor(Colors.Green) 73 | .setTimestamp(), 74 | ], 75 | ephemeral: ephemeral, 76 | }); 77 | } else { 78 | interaction.editReply({ 79 | embeds: [ 80 | new EmbedBuilder() 81 | .setTitle(json.message) 82 | .addFields([ 83 | { 84 | name: "Note:", 85 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 86 | }, 87 | ]) 88 | .setColor(Colors.Red) 89 | .setTimestamp() 90 | .setFooter({ text: "KeyAuth Discord Bot" }), 91 | ], 92 | ephemeral: ephemeral, 93 | }); 94 | } 95 | }); 96 | }, 97 | }; 98 | -------------------------------------------------------------------------------- /commands/Files/DeleteFile.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-file") 8 | .setDescription("Delete Existing File") 9 | .addStringOption((option) => 10 | option 11 | .setName("fileid") 12 | .setDescription("The file id of the file you would like to delete.") 13 | .setRequired(true), 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`); 20 | if (sellerkey === null) 21 | return interaction.editReply({ 22 | embeds: [ 23 | new EmbedBuilder() 24 | .setDescription( 25 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 26 | ) 27 | .setColor(Colors.Red) 28 | .setTimestamp(), 29 | ], 30 | ephemeral: ephemeral, 31 | }); 32 | let fileid = interaction.options.getString("fileid"); 33 | 34 | fetch( 35 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delfile&fileid=${fileid}`, 36 | ) 37 | .then((res) => res.json()) 38 | .then((json) => { 39 | if (json.success) { 40 | interaction.editReply({ 41 | embeds: [ 42 | new EmbedBuilder() 43 | .setTitle(json.message) 44 | .setColor(Colors.Blue) 45 | .setTimestamp(), 46 | ], 47 | ephemeral: ephemeral, 48 | }); 49 | } else { 50 | interaction.editReply({ 51 | embeds: [ 52 | new EmbedBuilder() 53 | .setTitle(json.message) 54 | .addFields([ 55 | { 56 | name: "Note:", 57 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 58 | }, 59 | ]) 60 | .setColor(Colors.Red) 61 | .setFooter({ text: "KeyAuth Discord Bot" }) 62 | .setTimestamp(), 63 | ], 64 | ephemeral: ephemeral, 65 | }); 66 | } 67 | }); 68 | }, 69 | }; 70 | -------------------------------------------------------------------------------- /commands/Files/DeleteFiles.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-files") 8 | .setDescription("Delete All Files"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`); 14 | if (sellerkey === null) 15 | return interaction.editReply({ 16 | embeds: [ 17 | new EmbedBuilder() 18 | .setDescription( 19 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 20 | ) 21 | .setColor(Colors.Red) 22 | .setTimestamp(), 23 | ], 24 | ephemeral: ephemeral, 25 | }); 26 | 27 | fetch( 28 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delallfiles`, 29 | ) 30 | .then((res) => res.json()) 31 | .then((json) => { 32 | if (json.success) { 33 | interaction.editReply({ 34 | embeds: [ 35 | new EmbedBuilder() 36 | .setTitle(json.message) 37 | .setColor(Colors.Blue) 38 | .setTimestamp(), 39 | ], 40 | ephemeral: ephemeral, 41 | }); 42 | } else { 43 | interaction.editReply({ 44 | embeds: [ 45 | new EmbedBuilder() 46 | .setTitle(json.message) 47 | .addFields([ 48 | { 49 | name: "Note:", 50 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 51 | }, 52 | ]) 53 | .setColor(Colors.Red) 54 | .setFooter({ text: "KeyAuth Discord Bot" }) 55 | .setTimestamp(), 56 | ], 57 | ephemeral: ephemeral, 58 | }); 59 | } 60 | }); 61 | }, 62 | }; 63 | -------------------------------------------------------------------------------- /commands/Files/EditFile.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("edit-file") 8 | .setDescription("Edit an existing file") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Edit an existing file", 11 | fi: "Muokkaa olemassa olevaa tiedostoa", 12 | fr: "Modifier un fichier existant", 13 | de: "Bearbeiten Sie eine vorhandene Datei", 14 | it: "Modifica un file esistente", 15 | nl: "Bewerk een bestaand bestand", 16 | ru: "Редактировать существующий файл", 17 | pl: "Edytuj istniejący plik", 18 | tr: "Mevcut bir dosyayı düzenle", 19 | cs: "Upravit existující soubor", 20 | ja: "既存のファイルを編集する", 21 | ko: "기존 파일 편집", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("fileid") 26 | .setDescription("The ID of the file you want to edit") 27 | .setRequired(true) 28 | ) 29 | .addStringOption((option) => 30 | option 31 | .setName("url") 32 | .setDescription("The new URL for the file") 33 | .setRequired(true) 34 | ) 35 | .addBooleanOption((option) => 36 | option 37 | .setName("authed") 38 | .setDescription("Whether authentication is required to access the file") 39 | .setRequired(true) 40 | ), 41 | async execute(interaction) { 42 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 43 | let ephemeral = !interaction.guild ? false : true; 44 | 45 | let sellerkey = await db.get(`token_${idfrom}`); 46 | if (sellerkey === null) 47 | return interaction.editReply({ 48 | embeds: [ 49 | new EmbedBuilder() 50 | .setDescription( 51 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\`, then \`/set-application\` Commands First.`, 52 | ) 53 | .setColor(Colors.Red) 54 | .setTimestamp(), 55 | ], 56 | ephemeral: ephemeral, 57 | }); 58 | 59 | let fileid = interaction.options.getString("fileid"); 60 | let url = interaction.options.getString("url"); 61 | let authed = interaction.options.getBoolean("authed"); 62 | 63 | fetch( 64 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=editfile&id=${fileid}&url=${url}&authed=${authed ? 1 : 0}` 65 | ) 66 | .then((res) => res.json()) 67 | .then((json) => { 68 | if (json.success) { 69 | interaction.editReply({ 70 | embeds: [ 71 | new EmbedBuilder() 72 | .setTitle("File Updated Successfully") 73 | .setDescription(json.message) 74 | .setColor(Colors.Green) 75 | .setTimestamp(), 76 | ], 77 | ephemeral: ephemeral, 78 | }); 79 | } else { 80 | interaction.editReply({ 81 | embeds: [ 82 | new EmbedBuilder() 83 | .setTitle("Failed to Update File") 84 | .setDescription(json.message) 85 | .addFields([ 86 | { 87 | name: "Note:", 88 | value: `Your seller key might be invalid. Change your seller key with \`/add-application\` command.`, 89 | }, 90 | ]) 91 | .setColor(Colors.Red) 92 | .setFooter({ text: "KeyAuth Discord Bot" }) 93 | .setTimestamp(), 94 | ], 95 | ephemeral: ephemeral, 96 | }); 97 | } 98 | }); 99 | }, 100 | }; -------------------------------------------------------------------------------- /commands/Files/UploadFile.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("upload-file") 8 | .setDescription("Upload a file") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Upload a file", 11 | fi: "Lataa tiedosto", 12 | fr: "Télécharger un fichier", 13 | de: "Lade eine Datei hoch", 14 | it: "Carica un file", 15 | nl: "Upload een bestand", 16 | ru: "Загрузить файл", 17 | pl: "Prześlij plik", 18 | tr: "Bir dosya yükle", 19 | cs: "Nahrát soubor", 20 | ja: "ファイルをアップロードする", 21 | ko: "파일 업로드", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("url") 26 | .setDescription( 27 | "The direct download link of the file you would like to upload.", 28 | ) 29 | .setDescriptionLocalizations({ 30 | "en-US": 31 | "The direct download link of the file you would like to upload.", 32 | fi: "Tiedoston URL, jonka haluat ladata", 33 | fr: "URL du fichier que vous souhaitez télécharger", 34 | de: "Datei-URL, die Sie hochladen möchten", 35 | it: "URL del file che desideri caricare", 36 | nl: "Bestands-URL die u wilt uploaden", 37 | ru: "URL-адрес файла, который вы хотите загрузить", 38 | pl: "Adres URL pliku, który chcesz przesłać", 39 | tr: "Yüklemek istediğiniz dosya URL'si", 40 | cs: "URL souboru, který chcete nahrát", 41 | ja: "アップロードしたいファイルのURL", 42 | ko: "업로드 할 파일 URL", 43 | }) 44 | .setRequired(true), 45 | ), 46 | async execute(interaction) { 47 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 48 | let ephemeral = !interaction.guild ? false : true; 49 | 50 | let sellerkey = await db.get(`token_${idfrom}`); 51 | if (sellerkey === null) 52 | return interaction.editReply({ 53 | embeds: [ 54 | new EmbedBuilder() 55 | .setDescription( 56 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 57 | ) 58 | .setColor(Colors.Red) 59 | .setTimestamp(), 60 | ], 61 | ephemeral: ephemeral, 62 | }); 63 | let url = interaction.options.getString("url"); 64 | 65 | fetch( 66 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=upload&url=${url}`, 67 | ) 68 | .then((res) => res.json()) 69 | .then((json) => { 70 | if (json.success) { 71 | interaction.editReply({ 72 | embeds: [ 73 | new EmbedBuilder() 74 | .setTitle(json.message) 75 | .setColor(Colors.Green) 76 | .setTimestamp(), 77 | ], 78 | ephemeral: ephemeral, 79 | }); 80 | } else { 81 | interaction.editReply({ 82 | embeds: [ 83 | new EmbedBuilder() 84 | .setTitle(json.message) 85 | .addFields([ 86 | { 87 | name: "Note:", 88 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 89 | }, 90 | ]) 91 | .setColor(Colors.Red) 92 | .setFooter({ text: "KeyAuth Discord Bot" }) 93 | .setTimestamp(), 94 | ], 95 | ephemeral: ephemeral, 96 | }); 97 | } 98 | }); 99 | }, 100 | }; 101 | -------------------------------------------------------------------------------- /commands/Licenses/AddTime.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-time") 8 | .setDescription("Add time to unused keys(use extend for used keys aka users)") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Add time to unused keys(use extend for used keys aka users)", 11 | "fi": "Lisää aikaa käyttämättömiin avaimiin (käytä extend käytettyihin avaimiin eli käyttäjiin)", 12 | "fr": "Ajouter du temps aux clés inutilisées (utiliser l'extension si la clé est utilisée)", 13 | "de": "Fügen Sie Zeit zu nicht verwendeten Schlüsseln hinzu (verwenden Sie Extend Used on Keys)", 14 | "it": "Aggiungi tempo a chiavi non utilizzate (usa extend per chiavi utilizzate, ovvero utenti)", 15 | "nl": "Voeg tijd toe aan ongebruikte sleutels (gebruik verlengen gebruikt op sleutels)", 16 | "ru": "Добавьте время к неиспользуемым ключам (используйте расширение, используемое для ключей)", 17 | "pl": "Dodaj czas do nieużywanych kluczy (użyj extend dla używanych kluczy, czyli użytkowników)", 18 | "tr": "Kullanılmayan tuşlara zaman ekleyin (tuşlarda kullanılan uzatmayı kullanın)", 19 | "cs": "Přidejte čas k nepoužívaným klíčům (použijte extend pro použité klíče, tedy uživatele)", 20 | "ja": "使用されていないキーに時間を追加します(使用されているキーにはextendを使用します)", 21 | "ko": "사용되지 않는 키에 시간을 추가하십시오 (사용된 키에는 extend를 사용하십시오)", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("time") 26 | .setDescription("Number of days") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Number of days", 29 | "fi": "Päivien määrä", 30 | "fr": "Nombre de jours", 31 | "de": "Anzahl der Tage", 32 | "it": "Numero di giorni", 33 | "nl": "Aantal dagen", 34 | "ru": "Количество дней", 35 | "pl": "Liczba dni", 36 | "tr": "Gün sayısı", 37 | "cs": "Počet dnů", 38 | "ja": "日数", 39 | "ko": "일 수", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | 45 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 46 | let ephemeral = !interaction.guild ? false : true; 47 | 48 | let sellerkey = await db.get(`token_${idfrom}`) 49 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 50 | 51 | let time = interaction.options.getString("time") 52 | 53 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=addtime&time=${time}`) 54 | .then(res => res.json()) 55 | .then(json => { 56 | if (json.success) { 57 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 58 | } else { 59 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 60 | } 61 | }) 62 | }, 63 | }; -------------------------------------------------------------------------------- /commands/Licenses/AssignLicense.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("assign-license") 8 | .setDescription("Assign a license to a user") 9 | .addStringOption((option) => 10 | option 11 | .setName("user") 12 | .setDescription("The username of the user to assign the license to") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("key") 18 | .setDescription("The license key to assign to the user") 19 | .setRequired(true) 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`); 26 | if (sellerkey === null) 27 | return interaction.editReply({ 28 | embeds: [ 29 | new EmbedBuilder() 30 | .setDescription( 31 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\`, then \`/set-application\` Commands First.`, 32 | ) 33 | .setColor(Colors.Red) 34 | .setTimestamp(), 35 | ], 36 | ephemeral: ephemeral, 37 | }); 38 | 39 | let username = interaction.options.getString("user"); 40 | let license = interaction.options.getString("key"); 41 | 42 | fetch( 43 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=assignkey&user=${username}&key=${license}`, 44 | ) 45 | .then((res) => res.json()) 46 | .then((json) => { 47 | if (json.success) { 48 | interaction.editReply({ 49 | embeds: [ 50 | new EmbedBuilder() 51 | .setTitle("License Assigned Successfully") 52 | .setDescription(`License key assigned to user: ${username}`) 53 | .setColor(Colors.Green) 54 | .setTimestamp(), 55 | ], 56 | ephemeral: ephemeral, 57 | }); 58 | } else { 59 | interaction.editReply({ 60 | embeds: [ 61 | new EmbedBuilder() 62 | .setTitle("Error") 63 | .setDescription(json.message || "Unknown error occurred") 64 | .addFields([ 65 | { 66 | name: "Note:", 67 | value: `Your seller key may be invalid. Change your seller key with \`/add-application\` command.`, 68 | }, 69 | ]) 70 | .setColor(Colors.Red) 71 | .setTimestamp() 72 | .setFooter({ text: "KeyAuth Discord Bot" }), 73 | ], 74 | ephemeral: ephemeral, 75 | }); 76 | } 77 | }) 78 | .catch((error) => { 79 | interaction.editReply({ 80 | embeds: [ 81 | new EmbedBuilder() 82 | .setTitle("Error") 83 | .setDescription(`Failed to connect to the KeyAuth API.`) 84 | .addFields([ 85 | { 86 | name: "Error Details:", 87 | value: `\`\`\`${error}\`\`\``, 88 | }, 89 | ]) 90 | .setColor(Colors.Red) 91 | .setTimestamp() 92 | .setFooter({ text: "KeyAuth Discord Bot" }), 93 | ], 94 | ephemeral: ephemeral, 95 | }); 96 | }); 97 | }, 98 | }; -------------------------------------------------------------------------------- /commands/Licenses/BanLicense.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("ban-license") 8 | .setDescription("Ban license key") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Ban license key", 11 | "fi": "Estä lisenssikoodi", 12 | "fr": "Interdire la clé de licence", 13 | "de": "Lizenzschlüssel sperren", 14 | "it": "Blocca la chiave di licenza", 15 | "nl": "Licentiesleutel verbannen", 16 | "ru": "Запретить лицензионный ключ", 17 | "pl": "Zbanuj klucz licencyjny", 18 | "tr": "Lisans anahtarını yasakla", 19 | "cs": "Zakáže licenční klíč", 20 | "ja": "ライセンスキーを禁止する", 21 | "ko": "라이센스 키 금지", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("key") 26 | .setDescription("Key you wish to ban") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Key you wish to ban", 29 | "fi": "Avain, jonka haluat estää", 30 | "fr": "Clé que vous souhaitez interdire", 31 | "de": "Schlüssel, den Sie sperren möchten", 32 | "it": "Chiave che desideri bloccare", 33 | "nl": "Sleutel die u wilt verbannen", 34 | "ru": "Ключ, который вы хотите запретить", 35 | "pl": "Klucz, który chcesz zbanować", 36 | "tr": "Yasaklamak istediğiniz anahtar", 37 | "cs": "Klíč, který chcete zakázat", 38 | "ja": "禁止したいキー", 39 | "ko": "금지하려는 키", 40 | }) 41 | .setRequired(true) 42 | ) 43 | .addStringOption((option) => 44 | option 45 | .setName("reason") 46 | .setDescription("Reason for the ban") 47 | .setDescriptionLocalizations({ 48 | "en-US": "Reason for the ban", 49 | "fi": "Syy bannille", 50 | "fr": "Raison du bannissement", 51 | "de": "Grund für die Sperrung", 52 | "it": "Motivo del ban", 53 | "nl": "Reden voor de ban", 54 | "ru": "Причина бана", 55 | "pl": "Powód bana", 56 | "tr": "Yasaklama nedeni", 57 | "cs": "Důvod pro zákaz", 58 | "ja": "禁止の理由", 59 | "ko": "금지의 이유", 60 | }) 61 | .setRequired(true) 62 | ) 63 | .addBooleanOption((option) => 64 | option 65 | .setName("usertoo") 66 | .setDescription("Ban user too?") 67 | .setRequired(false) 68 | ), 69 | async execute(interaction) { 70 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 71 | let ephemeral = !interaction.guild ? false : true; 72 | 73 | let sellerkey = await db.get(`token_${idfrom}`) 74 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 75 | 76 | let key = interaction.options.getString("key") 77 | let reason = interaction.options.getString("reason") 78 | let userToo = interaction.options.getBoolean("usertoo") ? 1 : 0; 79 | 80 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=ban&key=${key}&reason=${reason}&userToo=${userToo}`) 81 | .then(res => res.json()) 82 | .then(json => { 83 | if (json.success) { 84 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 85 | } else { 86 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 87 | } 88 | }) 89 | }, 90 | }; -------------------------------------------------------------------------------- /commands/Licenses/DeleteAllLicenses.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-licenses") 8 | .setDescription("Delete All Licenses"), 9 | async execute(interaction) { 10 | let idfrom = null; 11 | let ephemeral = true; 12 | 13 | if (interaction.guild == null) { 14 | idfrom = interaction.user.id; 15 | ephemeral = false; 16 | } 17 | else { 18 | idfrom = interaction.guild.id; 19 | } 20 | 21 | let sellerkey = await db.get(`token_${idfrom}`) 22 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delalllicenses`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | }) 33 | }, 34 | }; -------------------------------------------------------------------------------- /commands/Licenses/DeleteLicense.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-license") 8 | .setDescription("Delete a key") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete a key", 11 | "fi": "Poista avain", 12 | "fr": "Supprimer une clé", 13 | "de": "Schlüssel löschen", 14 | "it": "Elimina una chiave", 15 | "nl": "Sleutel verwijderen", 16 | "ru": "Удалить ключ", 17 | "pl": "Usuń klucz", 18 | "tr": "Bir anahtarı sil", 19 | "cs": "Odstranit klíč", 20 | "ja": "キーを削除する", 21 | "ko": "키 삭제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("license") 26 | .setDescription("Specify key you would like deleted") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Specify key you would like deleted", 29 | "fi": "Määritä poistettava avain", 30 | "fr": "Spécifiez la clé que vous souhaitez supprimer", 31 | "de": "Geben Sie den Schlüssel an, den Sie löschen möchten", 32 | "it": "Specifica la chiave che desideri eliminare", 33 | "nl": "Geef de sleutel op die u wilt verwijderen", 34 | "ru": "Укажите ключ, который вы хотите удалить", 35 | "pl": "Określ klucz, który chcesz usunąć", 36 | "tr": "Silmek istediğiniz anahtarı belirtin", 37 | "cs": "Zadejte klíč, který chcete odstranit", 38 | "ja": "削除したいキーを指定してください", 39 | "ko": "삭제할 키를 지정하십시오", 40 | }) 41 | .setRequired(true) 42 | ) 43 | .addBooleanOption((option) => 44 | option 45 | .setName("usertoo") 46 | .setDescription("Delete from user too?") 47 | .setRequired(false) 48 | ), 49 | async execute(interaction) { 50 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 51 | let ephemeral = !interaction.guild ? false : true; 52 | 53 | let sellerkey = await db.get(`token_${idfrom}`) 54 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 55 | 56 | let key = interaction.options.getString("license") 57 | let userToo = interaction.options.getBoolean("usertoo") ? 1 : 0; 58 | 59 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=del&key=${key}&userToo=${userToo}&format=json`) 60 | .then(res => res.json()) 61 | .then(json => { 62 | if (json.success) { 63 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Key Deleted:', value: `\`${key}\`` }]).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 64 | } 65 | else { 66 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 67 | } 68 | }) 69 | }, 70 | }; -------------------------------------------------------------------------------- /commands/Licenses/DeleteMultipleLicenses.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-multiple-licenses") 8 | .setDescription("Delete multiple licenses") 9 | .addStringOption((option) => 10 | option 11 | .setName("licenses") 12 | .setDescription("Specify key you would like deleted (seperate with comma and space)") 13 | .setRequired(true) 14 | ) 15 | .addBooleanOption((option) => 16 | option 17 | .setName("usertoo") 18 | .setDescription("Delete from user too?") 19 | .setRequired(false) 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`) 26 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 27 | 28 | let keys = interaction.options.getString("licenses") 29 | let userToo = interaction.options.getBoolean("usertoo") ? 1 : 0; 30 | 31 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delmultiple&key=${keys}&userToo=${userToo}&format=json`) 32 | .then(res => res.json()) 33 | .then(json => { 34 | if (json.success) { 35 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Keys Deleted:', value: `\`${keys}\`` }]).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 36 | } 37 | else { 38 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 39 | } 40 | }) 41 | }, 42 | }; -------------------------------------------------------------------------------- /commands/Licenses/DeleteUnusedLicenses.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-unused-licenses") 8 | .setDescription("Delete Unused Licenses") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete Unused Licenses", 11 | "fi": "Poista käyttämättömät lisenssit", 12 | "fr": "Supprimer les licences inutilisées", 13 | "de": "Unbenutzte Lizenzen löschen", 14 | "it": "Elimina licenze inutilizzate", 15 | "nl": "Verwijder ongebruikte licenties", 16 | "ru": "Удалить неиспользуемые лицензии", 17 | "pl": "Usuń nieużywane licencje", 18 | "tr": "Kullanılmayan Lisansları Sil", 19 | "cs": "Odstranit nepoužívané licence", 20 | "ja": "未使用のライセンスを削除する", 21 | "ko": "사용되지 않는 라이센스 삭제", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = null; 25 | let ephemeral = true; 26 | 27 | if (interaction.guild == null) { 28 | idfrom = interaction.user.id; 29 | ephemeral = false; 30 | } 31 | else { 32 | idfrom = interaction.guild.id; 33 | } 34 | 35 | let sellerkey = await db.get(`token_${idfrom}`) 36 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 37 | 38 | 39 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delunused`) 40 | .then(res => res.json()) 41 | .then(json => { 42 | if (json.success) { 43 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 44 | } else { 45 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 46 | } 47 | }) 48 | }, 49 | }; -------------------------------------------------------------------------------- /commands/Licenses/DeleteUsedLicenses.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-used-licenses") 8 | .setDescription("Delete Used Licenses") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete Used Licenses", 11 | "fi": "Poista käytetyt lisenssit", 12 | "fr": "Supprimer les licences utilisées", 13 | "de": "Verwendete Lizenzen löschen", 14 | "it": "Elimina licenze utilizzate", 15 | "nl": "Verwijder gebruikte licenties", 16 | "ru": "Удалить использованные лицензии", 17 | "pl": "Usuń używane licencje", 18 | "tr": "Kullanılan Lisansları Sil", 19 | "cs": "Odstranit použité licence", 20 | "ja": "使用済みのライセンスを削除する", 21 | "ko": "사용된 라이센스 삭제", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = null; 25 | let ephemeral = true; 26 | 27 | if (interaction.guild == null) { 28 | idfrom = interaction.user.id; 29 | ephemeral = false; 30 | } 31 | else { 32 | idfrom = interaction.guild.id; 33 | } 34 | 35 | let sellerkey = await db.get(`token_${idfrom}`) 36 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 37 | 38 | 39 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delused`) 40 | .then(res => res.json()) 41 | .then(json => { 42 | if (json.success) { 43 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 44 | } else { 45 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 46 | } 47 | }) 48 | }, 49 | }; -------------------------------------------------------------------------------- /commands/Licenses/LicenseInfo.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("license-info") 8 | .setDescription("Info On key") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Info On key", 11 | "fi": "Tietoja avaimesta", 12 | "fr": "Info sur la clé", 13 | "de": "Info zur Taste", 14 | "it": "Info sulla chiave", 15 | "nl": "Info over sleutel", 16 | "ru": "Информация о ключе", 17 | "pl": "Informacje o kluczu", 18 | "tr": "Anahtar hakkında bilgi", 19 | "cs": "Informace o klíči", 20 | "ja": "キーに関する情報", 21 | "ko": "키 정보", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("license") 26 | .setDescription("Specify key") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Specify key", 29 | "fi": "Määritä avain", 30 | "fr": "Spécifier la clé", 31 | "de": "Schlüssel angeben", 32 | "it": "Specifica la chiave", 33 | "nl": "Geef sleutel op", 34 | "ru": "Укажите ключ", 35 | "pl": "Określ klucz", 36 | "tr": "Anahtarı belirtin", 37 | "cs": "Zadejte klíč", 38 | "ja": "キーを指定する", 39 | "ko": "키 지정", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let key = interaction.options.getString("license") 51 | let hwid; 52 | let ip; 53 | 54 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=info&key=${key}`) 55 | .then(res => res.json()) 56 | .then(json => { 57 | if (!json.success) return interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 58 | if (json.hwid == null) { hwid == null } else { } 59 | 60 | const embed = new EmbedBuilder() 61 | .setTitle(`Key Information for ${key}`) 62 | .addFields([ 63 | { name: 'HWID:', value: `${hwid}` }, 64 | { name: 'Status:', value: `${json['status']}` }, 65 | { name: 'Level:', value: `${json['level']}` }, 66 | { name: 'Created By:', value: `${json['createdby']}` }, 67 | { name: 'Created On:', value: `${json['creationdate']}` }, 68 | ]) 69 | .setColor(Colors.Blue) 70 | .setTimestamp() 71 | 72 | interaction.editReply({ embeds: [embed], ephemeral: ephemeral }); 73 | }) 74 | }, 75 | }; -------------------------------------------------------------------------------- /commands/Licenses/SetLicenseNote.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("set-license-note") 8 | .setDescription("Set a note for a key") 9 | .addStringOption((option) => 10 | option 11 | .setName("note") 12 | .setDescription("Note to set") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("license") 18 | .setDescription("License to set note of") 19 | .setRequired(true) 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`) 26 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 27 | 28 | let note = interaction.options.getString("note") 29 | let license = interaction.options.getString("license") 30 | 31 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=setnote&key=${license}¬e=${note}&format=json`) 32 | .then(res => res.json()) 33 | .then(json => { 34 | if (json.success) { 35 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "grohom Discord Bot" })], ephemeral: ephemeral }) 36 | } else { 37 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "grohom Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 38 | } 39 | }) 40 | }, 41 | }; -------------------------------------------------------------------------------- /commands/Licenses/UnbanLicense.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("unban-license") 8 | .setDescription("Unban license key") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Unban license key", 11 | "fi": "Poista lisenssikoodin esto", 12 | "fr": "Débannir la clé de licence", 13 | "de": "Lizenzschlüssel freigeben", 14 | "it": "Sbanna la chiave di licenza", 15 | "nl": "Deban licentiesleutel", 16 | "ru": "Разбанить лицензионный ключ", 17 | "pl": "Odbanuj klucz licencyjny", 18 | "tr": "Lisans anahtarını debanlayın", 19 | "cs": "Odbanovat licenční klíč", 20 | "ja": "ライセンスキーの禁止を解除する", 21 | "ko": "라이센스 키 차단 해제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("key") 26 | .setDescription("Key you wish to unban") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Key you wish to unban", 29 | "fi": "Avain, jonka haluat poistaa estosta", 30 | "fr": "Clé que vous souhaitez débannir", 31 | "de": "Schlüssel, den Sie freigeben möchten", 32 | "it": "Chiave che desideri sbannare", 33 | "nl": "Sleutel die u wilt debannen", 34 | "ru": "Ключ, который вы хотите разбанить", 35 | "pl": "Klucz, który chcesz odbanować", 36 | "tr": "Debanlamak istediğiniz anahtar", 37 | "cs": "Klíč, který chcete odbanovat", 38 | "ja": "禁止を解除したいキー", 39 | "ko": "차단 해제하려는 키", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let key = interaction.options.getString("key") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=unban&key=${key}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (json.success) { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 57 | } else { 58 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 59 | } 60 | }) 61 | }, 62 | }; -------------------------------------------------------------------------------- /commands/Licenses/VerifyLicense.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("verify-license") 8 | .setDescription("Verify license exists") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Verify license exists", 11 | "fi": "Tarkista, että lisenssi on olemassa", 12 | "fr": "Vérifiez que la licence existe", 13 | "de": "Überprüfen Sie, ob die Lizenz vorhanden ist", 14 | "it": "Verifica che la licenza esista", 15 | "nl": "Controleer of de licentie bestaat", 16 | "ru": "Проверьте, существует ли лицензия", 17 | "pl": "Sprawdź, czy licencja istnieje", 18 | "tr": "Lisansın var olup olmadığını doğrulayın", 19 | "cs": "Ověřte, zda licenční klíč existuje", 20 | "ja": "ライセンスが存在することを確認します", 21 | "ko": "라이센스가 존재하는지 확인하십시오", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("license") 26 | .setDescription("License key you would like to check the existence of") 27 | .setDescriptionLocalizations({ 28 | "en-US": "License key you would like to check the existence of", 29 | "fi": "Lisenssikoodi, jonka olemassaolon haluat tarkistaa", 30 | "fr": "Clé de licence dont vous souhaitez vérifier l'existence", 31 | "de": "Lizenzschlüssel, dessen Existenz Sie überprüfen möchten", 32 | "it": "Chiave di licenza di cui desideri verificare l'esistenza", 33 | "nl": "Licentiesleutel waarvan u wilt controleren of deze bestaat", 34 | "ru": "Ключ лицензии, существование которого вы хотите проверить", 35 | "pl": "Klucz licencyjny, którego istnienie chcesz sprawdzić", 36 | "tr": "Varlığını kontrol etmek istediğiniz lisans anahtarınız", 37 | "cs": "Klíč licenčního klíče, jehož existenci chcete ověřit", 38 | "ja": "存在を確認したいライセンスキー", 39 | "ko": "존재 여부를 확인하려는 라이센스 키", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let key = interaction.options.getString("license") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=verify&key=${key}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (json.success) { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 57 | } 58 | else { 59 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 60 | } 61 | }) 62 | }, 63 | }; -------------------------------------------------------------------------------- /commands/Logs/DeleteAllLogs.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-logs") 8 | .setDescription("Delete all logs sent by using the .log function"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`); 14 | if (sellerkey === null) 15 | return interaction.editReply({ 16 | embeds: [ 17 | new EmbedBuilder() 18 | .setDescription( 19 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\`, then \`/set-application\` Commands First.`, 20 | ) 21 | .setColor(Colors.Red) 22 | .setTimestamp(), 23 | ], 24 | ephemeral: ephemeral, 25 | }); 26 | 27 | fetch( 28 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=dellogs`, 29 | ) 30 | .then((res) => res.json()) 31 | .then((json) => { 32 | if (json.success) { 33 | interaction.editReply({ 34 | embeds: [ 35 | new EmbedBuilder() 36 | .setTitle("Logs Deleted Successfully") 37 | .setDescription("All logs have been deleted.") 38 | .setColor(Colors.Green) 39 | .setTimestamp(), 40 | ], 41 | ephemeral: ephemeral, 42 | }); 43 | } else { 44 | interaction.editReply({ 45 | embeds: [ 46 | new EmbedBuilder() 47 | .setTitle("Error") 48 | .setDescription(json.message || "Unknown error occurred") 49 | .addFields([ 50 | { 51 | name: "Note:", 52 | value: `Your seller key may be invalid. Change your seller key with \`/add-application\` command.`, 53 | }, 54 | ]) 55 | .setColor(Colors.Red) 56 | .setTimestamp() 57 | .setFooter({ text: "KeyAuth Discord Bot" }), 58 | ], 59 | ephemeral: ephemeral, 60 | }); 61 | } 62 | }) 63 | .catch((error) => { 64 | interaction.editReply({ 65 | embeds: [ 66 | new EmbedBuilder() 67 | .setTitle("Error") 68 | .setDescription(`Failed to connect to the KeyAuth API.`) 69 | .addFields([ 70 | { 71 | name: "Error Details:", 72 | value: `\`\`\`${error}\`\`\``, 73 | }, 74 | ]) 75 | .setColor(Colors.Red) 76 | .setTimestamp() 77 | .setFooter({ text: "KeyAuth Discord Bot" }), 78 | ], 79 | ephemeral: ephemeral, 80 | }); 81 | }); 82 | }, 83 | }; -------------------------------------------------------------------------------- /commands/ResellerAndManager/DeleteAccount.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-account") 8 | .setDescription("Delete a reseller or manager account") 9 | .addStringOption((option) => 10 | option 11 | .setName("user") 12 | .setDescription("The username of the reseller or manager to delete") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`); 20 | if (sellerkey === null) 21 | return interaction.editReply({ 22 | embeds: [ 23 | new EmbedBuilder() 24 | .setDescription( 25 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\`, then \`/set-application\` Commands First.`, 26 | ) 27 | .setColor(Colors.Red) 28 | .setTimestamp(), 29 | ], 30 | ephemeral: ephemeral, 31 | }); 32 | 33 | const username = interaction.options.getString("user"); 34 | 35 | fetch( 36 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=deleteAccount&user=${username}`, 37 | ) 38 | .then((res) => res.json()) 39 | .then((json) => { 40 | if (json.success) { 41 | interaction.editReply({ 42 | embeds: [ 43 | new EmbedBuilder() 44 | .setTitle("Account Deleted Successfully") 45 | .setDescription(`Account deleted: ${username}`) 46 | .setColor(Colors.Green) 47 | .setTimestamp(), 48 | ], 49 | ephemeral: ephemeral, 50 | }); 51 | } else { 52 | interaction.editReply({ 53 | embeds: [ 54 | new EmbedBuilder() 55 | .setTitle("Error") 56 | .setDescription(json.message || "Unknown error occurred") 57 | .addFields([ 58 | { 59 | name: "Note:", 60 | value: `Your seller key may be invalid or the account doesn't exist.`, 61 | }, 62 | ]) 63 | .setColor(Colors.Red) 64 | .setTimestamp() 65 | .setFooter({ text: "KeyAuth Discord Bot" }), 66 | ], 67 | ephemeral: ephemeral, 68 | }); 69 | } 70 | }) 71 | .catch((error) => { 72 | interaction.editReply({ 73 | embeds: [ 74 | new EmbedBuilder() 75 | .setTitle("Error") 76 | .setDescription(`Failed to connect to the KeyAuth API.`) 77 | .addFields([ 78 | { 79 | name: "Error Details:", 80 | value: `\`\`\`${error}\`\`\``, 81 | }, 82 | ]) 83 | .setColor(Colors.Red) 84 | .setTimestamp() 85 | .setFooter({ text: "KeyAuth Discord Bot" }), 86 | ], 87 | ephemeral: ephemeral, 88 | }); 89 | }); 90 | }, 91 | }; -------------------------------------------------------------------------------- /commands/Sessions/KillAllSessions.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("kill-all-sessions") 8 | .setDescription("Kill All Existing Sessions") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Kill All Existing Sessions", 11 | "fi": "Tappaa kaikki olemassa olevat istunnot", 12 | "fr": "Tuez toutes les sessions existantes", 13 | "de": "Töten Sie alle vorhandenen Sitzungen", 14 | "it": "Uccidi tutte le sessioni esistenti", 15 | "nl": "Dood alle bestaande sessies", 16 | "ru": "Убейте все существующие сеансы", 17 | "pl": "Zabij wszystkie istniejące sesje", 18 | "tr": "Tüm Mevcut Oturumları Öldürün", 19 | "cs": "Zabijte všechny existující relace", 20 | "ja": "すべての既存のセッションを終了する", 21 | "ko": "모든 기존 세션 죽이기", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 25 | let ephemeral = !interaction.guild ? false : true; 26 | 27 | let sellerkey = await db.get(`token_${idfrom}`) 28 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 29 | 30 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=killall`) 31 | .then(res => res.json()) 32 | .then(json => { 33 | if (json.success) { 34 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle("Successfully Killed All Sessions").setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 35 | } else { 36 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 37 | } 38 | }) 39 | }, 40 | }; -------------------------------------------------------------------------------- /commands/Sessions/KillSession.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("kill-session") 8 | .setDescription("End Selected Session") 9 | .addStringOption((option) => 10 | option 11 | .setName("sessid") 12 | .setDescription("The session id you would like to end.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let sessid = interaction.options.getString("sessid") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=kill&sessid=${sessid}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | }) 33 | }, 34 | }; -------------------------------------------------------------------------------- /commands/Settings/AddApplication.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-application") 8 | .setDescription("Add an application / seller key to the database.") 9 | .addStringOption((option) => 10 | option 11 | .setName("sellerkey") 12 | .setDescription("Enter your seller key.") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("application") 18 | .setDescription("Enter your application name.") 19 | ), 20 | async execute(interaction) { 21 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 22 | let ephemeral = !interaction.guild ? false : true; 23 | let sellerkey = interaction.options.getString("sellerkey") 24 | 25 | const application = interaction.options.getString("application"); 26 | let temporary = !application ? sellerkey.substring(0, 6) : application 27 | // 28 | // console.log(temporary) 29 | if (application != null) { 30 | if (!/^[a-zA-Z0-9]+$/.test(application)) { 31 | return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your application name can only contain letters and numbers.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 32 | } 33 | } 34 | 35 | let applications = await db.get(`applications_${idfrom}`); 36 | if (applications === null) applications = []; 37 | if (applications.some(app => app.application === temporary)) { 38 | return interaction.editReply({ 39 | embeds: [ 40 | new EmbedBuilder() 41 | .setDescription(`The application \`${temporary}\` already exists.`) 42 | .setColor(Colors.Red) 43 | .setTimestamp() 44 | ], 45 | ephemeral: ephemeral 46 | }); 47 | } 48 | 49 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=setseller`) 50 | .then(res => res.json()) 51 | .then(async json => { 52 | if (json.success) { 53 | await applications.push({ 54 | application: !application ? sellerkey.substring(0, 6) : application, 55 | sellerkey: sellerkey, 56 | id: IdGenerator() 57 | }); 58 | await db.set(`applications_${idfrom}`, applications); 59 | interaction.editReply({ embeds: [new EmbedBuilder() 60 | .setTitle(`Application with name ${!application ? sellerkey.substring(0, 6) : application} has been added!`) 61 | .setColor(Colors.Green) 62 | .setTimestamp() 63 | .addFields([ 64 | { name: 'Next Step', value: 'Please use the command `/select-application` to start using this bot' } 65 | ])], ephemeral: ephemeral }) 66 | } 67 | else { 68 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 69 | } 70 | }) 71 | 72 | }, 73 | }; 74 | 75 | function IdGenerator() { 76 | var uuid = ""; 77 | var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 78 | for (var i = 0; i < 32; i++) { 79 | uuid += possible.charAt(Math.floor(Math.random() * possible.length)); 80 | } 81 | return uuid; 82 | } 83 | -------------------------------------------------------------------------------- /commands/Settings/FetchApplicationSettings.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("fetch-application-settings") 8 | .setDescription("Get Current Settings"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !!interaction.guild; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | try { 17 | const response = await fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=getsettings`); 18 | const json = await response.json(); 19 | 20 | if (json.success) { 21 | const fields = [ 22 | { name: 'Enabled', value: json.enabled ? "Enabled" : "Disabled" }, 23 | { name: 'HWID Lock', value: json["hwid-lock"] ? "Enabled" : "Disabled" }, 24 | { name: 'Version', value: json.version || "not set" }, 25 | { name: 'Download', value: json.download || "not set" }, 26 | { name: 'Web Download', value: json.webdownload || "not set" }, 27 | { name: 'Webhook', value: json.webhook || "not set" }, 28 | { name: 'Reseller Store', value: json.resellerstore || "not set" }, 29 | { name: 'Disabled Message', value: json.disabledmsg || "not set" }, 30 | { name: 'Username Taken Message', value: json.usernametakenmsg || "not set" }, 31 | { name: 'License Invalid Message', value: json.licenseinvalidmsg || "not set" }, 32 | { name: 'Key Taken Message', value: json.keytakenmsg || "not set" }, 33 | { name: 'No Subscription Message', value: json.nosubmsg || "not set" }, 34 | { name: 'Invalid Username Message', value: json.userinvalidmsg || "not set" }, 35 | { name: 'Password Invalid Message', value: json.passinvalidmsg || "not set" }, 36 | { name: 'HWID Mismatch Message', value: json.hwidmismatchmsg || "not set" }, 37 | { name: 'No Active Subscription Message', value: json.noactivesubmsg || "not set" }, 38 | { name: 'Blacklisted Message', value: json.blackedmsg || "not set" }, 39 | { name: 'Paused Message', value: json.pausedmsg || "not set" }, 40 | { name: 'Sellix Secret', value: json.sellixsecret || "not set" }, 41 | { name: 'Day Reseller Product ID', value: json.dayresellerproductid || "not set" }, 42 | { name: 'Week Reseller Product ID', value: json.weekresellerproductid || "not set" }, 43 | { name: 'Month Reseller Product ID', value: json.monthresellerproductid || "not set" }, 44 | { name: 'Lifetime Reseller Product ID', value: json.liferesellerproductid || "not set" }, 45 | { name: 'Cooldown', value: (json.cooldown || "not set") + (json.cooldown ? ' seconds' : '') }, 46 | ]; 47 | 48 | const embed = new EmbedBuilder() 49 | .setTitle(json.message) 50 | .setColor([133, 239, 147]) 51 | .addFields(fields.filter(field => field.value !== "not set")); 52 | 53 | await interaction.editReply({ embeds: [embed] }); 54 | } else { 55 | await interaction.editReply({ 56 | embeds: [new EmbedBuilder() 57 | .setTitle(json.message) 58 | .addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]) 59 | .setColor(Colors.Red) 60 | .setFooter({ text: "KeyAuth Discord Bot" }) 61 | .setTimestamp() 62 | ], 63 | ephemeral: ephemeral 64 | }); 65 | } 66 | } catch (error) { 67 | console.error('Error fetching application settings:', error); 68 | await interaction.editReply({ 69 | embeds: [new EmbedBuilder() 70 | .setTitle('Error') 71 | .setDescription('An error occurred while fetching application settings. Please try again later.') 72 | .setColor(Colors.Red) 73 | .setTimestamp() 74 | ], 75 | ephemeral: ephemeral 76 | }); 77 | } 78 | }, 79 | }; -------------------------------------------------------------------------------- /commands/Settings/PauseApplication.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("pause-application") 8 | .setDescription("Pause Application"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=pauseapp`) 17 | .then(res => res.json()) 18 | .then(json => { 19 | if (json.success) { 20 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 21 | } else { 22 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 23 | } 24 | 25 | }) 26 | }, 27 | }; -------------------------------------------------------------------------------- /commands/Settings/RemoveApplication.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database'); 3 | const fetch = require('node-fetch'); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("remove-application") 8 | .setDescription("Removes an application or seller key from the bot.") 9 | .addStringOption((option) => 10 | option 11 | .setName("application") 12 | .setDescription("Enter the name of the application you'd like to delete.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | // Determine the ID context for database queries 17 | const idFromGuild = interaction.guild ? interaction.guild.id : interaction.user.id; 18 | 19 | // Set ephemeral flag based on the context 20 | const ephemeral = !!interaction.guild; 21 | 22 | // Extract the specified application name from interaction options 23 | const application = interaction.options.getString("application"); 24 | 25 | // Retrieve existing applications from the database 26 | let applications = await db.get(`applications_${idFromGuild}`); 27 | 28 | // Initialize an empty array if no applications exist yet 29 | if (applications === null) { 30 | applications = []; 31 | } 32 | 33 | // Inform if no applications exist 34 | if (applications.length === 0) { 35 | return interaction.editReply({ 36 | embeds: [ 37 | new EmbedBuilder() 38 | .setDescription("No applications have been added yet.") 39 | .setColor(Colors.Red) 40 | .setTimestamp() 41 | ], 42 | ephemeral: ephemeral 43 | }); 44 | } 45 | 46 | // Inform if application name is not specified 47 | if (!application) { 48 | return interaction.editReply({ 49 | embeds: [ 50 | new EmbedBuilder() 51 | .setDescription("Enter the name of the application you'd like to delete.") 52 | .setColor(Colors.Red) 53 | .setTimestamp() 54 | ], 55 | ephemeral: ephemeral 56 | }); 57 | } 58 | 59 | // Filter out the specified application from the applications array 60 | const deletedApplications = applications.filter(app => app.application === application); 61 | 62 | // Inform if specified application does not exist 63 | if (deletedApplications.length === 0) { 64 | return interaction.editReply({ 65 | embeds: [ 66 | new EmbedBuilder() 67 | .setDescription(`The application \`${application}\` does not exist.`) 68 | .setColor(Colors.Red) 69 | .setTimestamp() 70 | ], 71 | ephemeral: ephemeral 72 | }); 73 | } 74 | 75 | // Remove all occurrences of specified application from the applications array 76 | applications = applications.filter(app => app.application !== application); 77 | 78 | // Update the applications in the database 79 | await db.set(`applications_${idFromGuild}`, applications); 80 | 81 | // Inform about successful deletion 82 | interaction.editReply({ 83 | embeds: [ 84 | new EmbedBuilder() 85 | .setTitle(`The application(s) with the name ${application} have been deleted!`) 86 | .setColor(Colors.Green) 87 | .setTimestamp() 88 | ], 89 | ephemeral: ephemeral 90 | }); 91 | }, 92 | }; 93 | -------------------------------------------------------------------------------- /commands/Settings/SelectApplication.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder, ButtonBuilder, ButtonStyle, ActionRowBuilder } = require("discord.js"); 2 | const db = require('../../utils/database'); 3 | 4 | module.exports = { 5 | data: new SlashCommandBuilder() 6 | .setName("select-application") 7 | .setDescription("Select an application / seller key to use."), 8 | 9 | async execute(interaction) { 10 | const idFromGuild = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | const ephemeral = !!interaction.guild; 12 | let applications = await db.get(`applications_${idFromGuild}`) || []; 13 | 14 | if (applications.length === 0) { 15 | const noApplicationsEmbed = new EmbedBuilder() 16 | .setTitle(`Hey ${interaction.user.username} 👋`) 17 | .setDescription(`Please use the \`/add-application\` command to add applications.`) 18 | .setColor(Colors.Blue) 19 | .setThumbnail("https://cdn.keyauth.cc/front/assets/img/favicon.png") 20 | .setFooter({ text: "KeyAuth Discord Bot" }) 21 | .setTimestamp(); 22 | 23 | return interaction.editReply({ embeds: [noApplicationsEmbed], ephemeral }); 24 | } 25 | 26 | const buttons = applications.map((app) => 27 | new ButtonBuilder() 28 | .setCustomId(`selectapp_${app.id}`) 29 | .setLabel(app.application) 30 | .setStyle(ButtonStyle.Primary) 31 | ); 32 | 33 | const rows = []; 34 | for (let i = 0; i < buttons.length; i += 5) { 35 | const actionRow = new ActionRowBuilder().addComponents(buttons.slice(i, i + 5)); 36 | rows.push(actionRow); 37 | } 38 | 39 | const Embed = new EmbedBuilder() 40 | .setTitle(`Hey ${interaction.user.username} 👋`) 41 | .setDescription(` 42 | Please select below the application you want to use with the bot. 43 | 44 | 🔔**Note:** If you want to add new applications, you can do it with the \`/add-application\` command.\n\n 45 | ⚠️**Friendly Reminder:** You can only select one application at a time. Also, if you add a new application without specifying its name, rest assured, the first 6 letters of the seller key will be automatically utilized, with the remaining characters obscured for security. 46 | `) 47 | .setColor(Colors.Blue) 48 | .setThumbnail("https://cdn.keyauth.cc/front/assets/img/favicon.png") 49 | .setFooter({ text: "KeyAuth Discord Bot" }) 50 | .setTimestamp(); 51 | 52 | interaction.editReply({ content: `Select an application to use:`, components: rows, embeds: [Embed], ephemeral }); 53 | }, 54 | }; 55 | -------------------------------------------------------------------------------- /commands/Settings/SetLicenseMask.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | 4 | module.exports = { 5 | data: new SlashCommandBuilder() 6 | .setName("set-license-mask") 7 | .setDescription("Sets the license key mask.") 8 | .setDescriptionLocalizations({ 9 | "en-US": "Sets the license key mask.", 10 | "fi": "Asettaa lisenssikoodin maskin", 11 | "fr": "Définit le masque de clé de licence", 12 | "de": "Setzt das Lizenzschlüssel-Masken", 13 | "it": "Imposta la maschera della chiave di licenza", 14 | "nl": "Stelt de licentiesleutelmasker in", 15 | "ru": "Устанавливает маску лицензионного ключа", 16 | "pl": "Ustawia maskę klucza licencyjnego", 17 | "tr": "Lisans Anahtarını maske ayarlar", 18 | "cs": "Nastaví masku klíče licence", 19 | "ja": "ライセンスキーのマスクを設定します", 20 | "ko": "라이센스 키 마스크를 설정합니다", 21 | }) 22 | .addStringOption((option) => 23 | option 24 | .setName("mask") 25 | .setDescription("Set the mask for the license. (blank = default)") 26 | .setDescriptionLocalizations({ 27 | "en-US": "Set the mask for the license. (blank = default)", 28 | "fi": "Määritä lisenssi maski / (null = oletus)", 29 | "fr": "Spécifiez le masque pour la licence / (null = par défaut)", 30 | "de": "Geben Sie das Masken für die Lizenz an / (null = Standard)", 31 | "it": "Specifica la maschera per la licenza / (null = predefinito)", 32 | "nl": "Geef het masker voor de licentie op / (null = standaard)", 33 | "ru": "Укажите маску для лицензии / (null = по умолчанию)", 34 | "pl": "Określ maskę dla licencji / (null = domyślny)", 35 | "tr": "Lisans için maske belirtin / (null = varsayılan)", 36 | "cs": "Zadejte masku pro licenci / (null = výchozí)", 37 | "ja": "ライセンスのマスクを指定します / (null = デフォルト)", 38 | "ko": "라이센스에 대한 마스크를 지정하십시오 / (null = 기본값)", 39 | }) 40 | .setRequired(true) 41 | ), 42 | async execute(interaction) { 43 | 44 | let license_mask = null; // LEAVE EMPTY 45 | let licensestring = interaction.options.getString("mask"); // LICENSE STRING == USER INPUT ON MASK 46 | 47 | if (licensestring === "null") // IF USER INPUT == null IT WILL SET UP DEFAULT KEY AS YOU SEE 48 | license_mask = "XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX"; 49 | else 50 | license_mask = licensestring; // ELSE IT WILL PUT USER INPUT AS MASK 51 | 52 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 53 | let ephemeral = !interaction.guild ? false : true; 54 | 55 | db.get(`licensemask_${idfrom}`) 56 | db.set(`licensemask_${idfrom}`, license_mask) 57 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle('License mask successfully set!').setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 58 | 59 | }, 60 | }; -------------------------------------------------------------------------------- /commands/Settings/SetLogging.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | 4 | module.exports = { 5 | data: new SlashCommandBuilder() 6 | .setName("set-logging") 7 | .setDescription("Set a Discord webhook to log commands used on this bot.") 8 | .setDescriptionLocalizations({ 9 | "en-US": "Set a Discord webhook to log commands used on this bot.", 10 | "fi": "Asettaa Discord-webhookin lokitukseen käytetyt komennot tässä botti.", 11 | "fr": "Définit un webhook Discord pour enregistrer les commandes utilisées sur ce bot.", 12 | "de": "Stellt einen Discord-Webhook ein, um Befehle zu protokollieren, die auf diesem Bot verwendet werden.", 13 | "it": "Imposta un webhook Discord per registrare i comandi utilizzati su questo bot.", 14 | "nl": "Stelt een Discord-webhook in om opdrachten te loggen die op deze bot worden gebruikt.", 15 | "ru": "Устанавливает Discord-веб-хук для регистрации команд, используемых в этом боте.", 16 | "pl": "Ustawia webhook Discord do rejestrowania poleceń używanych w tym bocie.", 17 | "tr": "Bu bot üzerinde kullanılan komutları günlüğe kaydetmek için bir Discord webhook ayarlar.", 18 | "cs": "Nastaví Discord webhook pro zaznamenávání příkazů použitých v tomto botovi.", 19 | "ja": "このボットで使用されたコマンドを記録するためのDiscord Webhookを設定します。", 20 | "ko": "이 봇에서 사용된 명령을 로그로 기록하기 위해 Discord 웹 훅을 설정합니다.", 21 | }) 22 | .addStringOption((option) => 23 | option 24 | .setName("webhook") 25 | .setDescription("Enter the webhook URL.") 26 | .setDescriptionLocalizations({ 27 | "en-US": "Enter the webhook URL.", 28 | "fi": "Enter the webhook URL.", 29 | "fr": "URL de webhook Discord", 30 | "de": "Discord-Webhook-URL", 31 | "it": "URL webhook Discord", 32 | "nl": "Discord-webhook-URL", 33 | "ru": "URL Discord-веб-хука", 34 | "pl": "URL webhook Discord", 35 | "tr": "Enter the webhook URL.", 36 | "cs": "URL webhook Discord", 37 | "ja": "Enter the webhook URL.", 38 | "ko": "Discord 웹 훅 URL", 39 | }) 40 | .setRequired(true) 41 | ), 42 | async execute(interaction) { 43 | 44 | let webhook = interaction.options.getString("webhook") 45 | 46 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 47 | let ephemeral = !interaction.guild ? false : true; 48 | 49 | db.get(`wh_url_${idfrom}`) 50 | db.set(`wh_url_${idfrom}`, webhook) 51 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle('Successfully set discord webhook to log commands to').setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 52 | 53 | }, 54 | }; -------------------------------------------------------------------------------- /commands/Settings/UnPauseApplication.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("unpause-application") 8 | .setDescription("Unpause Application"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=unpauseapp`) 17 | .then(res => res.json()) 18 | .then(json => { 19 | if (json.success) { 20 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 21 | } else { 22 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 23 | } 24 | 25 | }) 26 | }, 27 | }; -------------------------------------------------------------------------------- /commands/Subscriptions/AddSubscription.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-subscription") 8 | .setDescription("Add Subscription") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Add Subscription", 11 | "fi": "Lisää tilaus", 12 | "fr": "Ajouter une abonnement", 13 | "de": "Abonnement hinzufügen", 14 | "it": "Aggiungi abbonamento", 15 | "nl": "Abonnement toevoegen", 16 | "ru": "Добавить подписку", 17 | "pl": "Dodaj subskrypcję", 18 | "tr": "Abonelik ekle", 19 | "cs": "Přidat předplatné", 20 | "ja": "サブスクリプションを追加する", 21 | "ko": "구독 추가", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("name") 26 | .setDescription("Subscription Name?") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Subscription Name?", 29 | "fi": "Tilausnimi?", 30 | "fr": "Nom de l'abonnement?", 31 | "de": "Abonnementname?", 32 | "it": "Nome dell'abbonamento?", 33 | "nl": "Abonnementnaam?", 34 | "ru": "Название подписки?", 35 | "pl": "Nazwa subskrypcji?", 36 | "tr": "Abonelik adı?", 37 | "cs": "Název předplatného?", 38 | "ja": "サブスクリプション名?", 39 | "ko": "구독 이름?", 40 | }) 41 | .setRequired(true) 42 | ) 43 | .addStringOption((option) => 44 | option 45 | .setName("level") 46 | .setDescription("Subscription Level?") 47 | .setDescriptionLocalizations({ 48 | "en-US": "Subscription Level?", 49 | "fi": "Tilaustaso?", 50 | "fr": "Niveau d'abonnement?", 51 | "de": "Abonnementstufe?", 52 | "it": "Livello di abbonamento?", 53 | "nl": "Abonnementsniveau?", 54 | "ru": "Уровень подписки?", 55 | "pl": "Poziom subskrypcji?", 56 | "tr": "Abonelik seviyesi?", 57 | "cs": "Úroveň předplatného?", 58 | "ja": "サブスクリプションレベル?", 59 | "ko": "구독 레벨?", 60 | }) 61 | .setRequired(true) 62 | ), 63 | async execute(interaction) { 64 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 65 | let ephemeral = !interaction.guild ? false : true; 66 | 67 | let sellerkey = await db.get(`token_${idfrom}`) 68 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 69 | 70 | let subname = interaction.options.getString("name") 71 | let sublevel = interaction.options.getString("level") 72 | 73 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=addsub&name=${subname}&level=${sublevel}`) 74 | .then(res => res.json()) 75 | .then(json => { 76 | if (json.success) { 77 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 78 | } else { 79 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 80 | } 81 | }) 82 | }, 83 | }; -------------------------------------------------------------------------------- /commands/Subscriptions/CountSubscriptions.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("count-subscriptions") 8 | .setDescription("Retrieve user variable") 9 | .addStringOption((option) => 10 | option 11 | .setName("name") 12 | .setDescription("The subscription name") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let name = interaction.options.getString("name") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=countsubs&name=${name}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Subscriptions/DeleteApplicationSubscription.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-application-subscriptions") 8 | .setDescription("Delete Exisiting Subscription from application") 9 | .addStringOption((option) => 10 | option 11 | .setName("name") 12 | .setDescription("The name of the subscription you would like to delete.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let name = interaction.options.getString("name") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delappsub&name=${name}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 29 | } 30 | else { 31 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 32 | } 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Subscriptions/EditApplicationSubscription.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("edit-application-subscriptions") 8 | .setDescription("Edit Subscription") 9 | .addStringOption((option) => 10 | option 11 | .setName("sub") 12 | .setDescription("The subscription you would like to edit.") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("level") 18 | .setDescription("The new level for the subscription.") 19 | .setRequired(true) 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`) 26 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 27 | 28 | let sub = interaction.options.getString("sub") 29 | let level = interaction.options.getString("level") 30 | 31 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=editsub&sub=${sub}&level=${level}`) 32 | .then(res => res.json()) 33 | .then(json => { 34 | if (json.success) { 35 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 36 | } else { 37 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 38 | } 39 | 40 | }) 41 | }, 42 | }; -------------------------------------------------------------------------------- /commands/Subscriptions/PauseApplicationSubscription.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("pause-application-subscriptions") 8 | .setDescription("Pause Subscription(s)") 9 | .addStringOption((option) => 10 | option 11 | .setName("subscription") 12 | .setDescription("Default 'subscription'") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let sub = interaction.options.getString("subscription") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=pausesub&subscription=${sub}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Subscriptions/UnPauseApplicationSubscription.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("unpause-subscription") 8 | .setDescription("Unpause Subscription(s)") 9 | .addStringOption((option) => 10 | option 11 | .setName("subscription") 12 | .setDescription("Default 'subscription'") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let sub = interaction.options.getString("subscription") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=unpausesub&subscription=${sub}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Users/BanUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("ban-user") 8 | .setDescription("Ban user") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Ban user", 11 | "fi": "Estä käyttäjä", 12 | "fr": "Bannir l'utilisateur", 13 | "de": "Benutzer sperren", 14 | "it": "Banna l'utente", 15 | "nl": "Blokkeer gebruiker", 16 | "ru": "Забанить пользователя", 17 | "pl": "Zbanuj użytkownika", 18 | "tr": "Kullanıcıyı yasakla", 19 | "cs": "Zakázat uživatele", 20 | "ja": "ユーザーを禁止する", 21 | "ko": "사용자를 금지하다", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("user") 26 | .setDescription("Enter the username of the user you'd like to ban.") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Enter the username of the user you'd like to ban.", 29 | "fi": "Käyttäjä, jonka haluat estää", 30 | "fr": "Utilisateur que vous souhaitez bannir", 31 | "de": "Benutzer, den Sie sperren möchten", 32 | "it": "Utente che desideri bannare", 33 | "nl": "Gebruiker die u wilt blokkeren", 34 | "ru": "Пользователь, которого вы хотите забанить", 35 | "pl": "Użytkownik, którego chcesz zbanować", 36 | "tr": "Yasaklamak istediğiniz kullanıcı", 37 | "cs": "Uživatel, kterého chcete zakázat", 38 | "ja": "禁止したいユーザー", 39 | "ko": "금지하려는 사용자", 40 | }) 41 | .setRequired(true) 42 | ) 43 | .addStringOption((option) => 44 | option 45 | .setName("reason") 46 | .setDescription("Enter the reason for the ban.") 47 | .setDescriptionLocalizations({ 48 | "en-US": "Enter the reason for the ban.", 49 | "fi": "Syy bannille", 50 | "fr": "Raison du bannissement", 51 | "de": "Grund für die Sperrung", 52 | "it": "Motivo del ban", 53 | "nl": "Reden voor de ban", 54 | "ru": "Причина бана", 55 | "pl": "Powód banowania", 56 | "tr": "Yasaklama nedeni", 57 | "cs": "Důvod pro zakázání", 58 | "ja": "禁止の理由", 59 | "ko": "금지의 이유", 60 | }) 61 | .setRequired(true) 62 | ), 63 | async execute(interaction) { 64 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 65 | let ephemeral = !interaction.guild ? false : true; 66 | 67 | let sellerkey = await db.get(`token_${idfrom}`) 68 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 69 | 70 | let user = interaction.options.getString("user") 71 | let reason = interaction.options.getString("reason") 72 | 73 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=banuser&user=${user}&reason=${reason}`) 74 | .then(res => res.json()) 75 | .then(json => { 76 | if (json.success) { 77 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 78 | } else { 79 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 80 | } 81 | }) 82 | }, 83 | }; -------------------------------------------------------------------------------- /commands/Users/DeleteAllUsers.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-users") 8 | .setDescription("Delete all users"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delallusers`) 17 | .then(res => res.json()) 18 | .then(json => { 19 | if (json.success) { 20 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 21 | } else { 22 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 23 | } 24 | 25 | }) 26 | }, 27 | }; -------------------------------------------------------------------------------- /commands/Users/DeleteExpiredUsers.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-expired-users") 8 | .setDescription("Delete users with no active subscription.") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete users with no active subscription.", 11 | "fi": "Poista käyttäjät, joilla ei ole aktiivisia tilauksia", 12 | "fr": "Supprimer les utilisateurs sans abonnement actif", 13 | "de": "Benutzer mit keinem aktiven Abonnement löschen", 14 | "it": "Elimina gli utenti senza sottoscrizioni attive", 15 | "nl": "Gebruikers met geen actieve abonnementen verwijderen", 16 | "ru": "Удалить пользователей без активных подписок", 17 | "pl": "Usuń użytkowników bez aktywnych subskrypcji", 18 | "tr": "Aktif abonelik olmayan kullanıcıları sil", 19 | "cs": "Odstranit uživatele bez aktivních předplatných", 20 | "ja": "アクティブなサブスクリプションのないユーザーを削除する", 21 | "ko": "활성 구독이없는 사용자 삭제", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 25 | let ephemeral = !interaction.guild ? false : true; 26 | 27 | let sellerkey = await db.get(`token_${idfrom}`) 28 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 29 | 30 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delexpusers`) 31 | .then(res => res.json()) 32 | .then(json => { 33 | if (json.success) { 34 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 35 | } else { 36 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 37 | } 38 | }) 39 | }, 40 | }; -------------------------------------------------------------------------------- /commands/Users/DeleteUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-user") 8 | .setDescription("Delete user") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Delete user", 11 | "fi": "Poista käyttäjä", 12 | "fr": "Supprimer l'utilisateur", 13 | "de": "Benutzer löschen", 14 | "it": "Elimina utente", 15 | "nl": "Verwijder gebruiker", 16 | "ru": "Удалить пользователя", 17 | "pl": "Usuń użytkownika", 18 | "tr": "Kullanıcıyı sil", 19 | "cs": "Smazat uživatele", 20 | "ja": "ユーザーを削除する", 21 | "ko": "사용자 삭제", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("username") 26 | .setDescription("Enter the username of the user you'd like to delete.") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Enter the username of the user you'd like to delete.", 29 | "fi": "Anna käyttäjätunnus", 30 | "fr": "Entrez le nom d'utilisateur", 31 | "de": "Geben Sie den Benutzernamen ein", 32 | "it": "Inserisci il nome utente", 33 | "nl": "Voer gebruikersnaam in", 34 | "ru": "Введите имя пользователя", 35 | "pl": "Wprowadź nazwę użytkownika", 36 | "tr": "Kullanıcı adını girin", 37 | "cs": "Zadejte uživatelské jméno", 38 | "ja": "ユーザー名を入力してください", 39 | "ko": "사용자 이름을 입력하십시오", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let un = interaction.options.getString("username") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=deluser&user=${un}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (json.success) { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 57 | } else { 58 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 59 | } 60 | }) 61 | 62 | }, 63 | }; -------------------------------------------------------------------------------- /commands/Users/EditEmail.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("edit-email") 8 | .setDescription("Change users email address.") 9 | .addStringOption((option) => 10 | option 11 | .setName("user") 12 | .setDescription("The username of the user you'd like to change email for.") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("email") 18 | .setDescription("Enter the new email address.") 19 | .setRequired(true) 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`) 26 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 27 | 28 | let user = interaction.options.getString("user") 29 | let email = interaction.options.getString("email") 30 | 31 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=editemail&user=${user}&email=${email}`) 32 | .then(res => res.json()) 33 | .then(json => { 34 | if (json.success) { 35 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 36 | } else { 37 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 38 | } 39 | 40 | }) 41 | }, 42 | }; -------------------------------------------------------------------------------- /commands/Users/EditUsername.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("edit-username") 8 | .setDescription("Change users username.") 9 | .addStringOption((option) => 10 | option 11 | .setName("currentusername") 12 | .setDescription("The username of the user you'd like to change.") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("newusername") 18 | .setDescription("Default 'newusername'") 19 | .setRequired(true) 20 | ) 21 | .addStringOption((option) => 22 | option 23 | .setName("sessionid") 24 | .setDescription("Default 'sessionid'") 25 | .setRequired(true) 26 | ), 27 | async execute(interaction) { 28 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 29 | let ephemeral = !interaction.guild ? false : true; 30 | 31 | let sellerkey = await db.get(`token_${idfrom}`) 32 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 33 | 34 | let currentusername = interaction.options.getString("currentusername") 35 | let newusername = interaction.options.getString("newusername") || "newusername" 36 | let sessionid = interaction.options.getString("sessionid") || "sessionid" 37 | 38 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=editusername¤tUsername=${currentusername}&newUsername=${newusername}&sessionID=${sessionid}`) 39 | .then(res => res.json()) 40 | .then(json => { 41 | if (json.success) { 42 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 43 | } else { 44 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 45 | } 46 | 47 | }) 48 | }, 49 | }; -------------------------------------------------------------------------------- /commands/Users/FetchLicenseFromUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("get-license-from-user") 8 | .setDescription("Get a users license.") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Get a users license.", 11 | "fi": "Hae lisenssi käyttäjältä", 12 | "fr": "Obtenir une licence de l'utilisateur", 13 | "de": "Lizenz von Benutzer erhalten", 14 | "it": "Ottieni licenza dall'utente", 15 | "nl": "Licentie van gebruiker ophalen", 16 | "ru": "Получить лицензию от пользователя", 17 | "pl": "Uzyskaj licencję od użytkownika", 18 | "tr": "Kullanıcıdan lisans al", 19 | "cs": "Získejte licenci od uživatele", 20 | "ja": "ユーザーからライセンスを取得する", 21 | "ko": "사용자로부터 라이센스 가져 오기", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("username") 26 | .setDescription("Username of the user you're getting the license from.") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Username of the user you're getting the license from.", 29 | "fi": "Käyttäjätunnus, johon haluat lisenssin", 30 | "fr": "Nom d'utilisateur où vous souhaitez la licence", 31 | "de": "Benutzername, an dem Sie die Lizenz möchten", 32 | "it": "Nome utente dove vuoi la licenza", 33 | "nl": "Gebruikersnaam waar u de licentie wilt", 34 | "ru": "Имя пользователя, где вы хотите лицензию", 35 | "pl": "Nazwa użytkownika, w której chcesz licencję", 36 | "tr": "Lisans istediğiniz kullanıcı adı", 37 | "cs": "Uživatelské jméno, kde chcete licenci", 38 | "ja": "ライセンスを取得したいユーザー名", 39 | "ko": "라이센스를 원하는 사용자 이름", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let un = interaction.options.getString("username") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=getkey&user=${un}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (json.success) { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(`License From ${un}`).addFields([{ name: 'License:', value: `\`${json['key']}\`` }]).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 57 | } else { 58 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(`Failure`).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 59 | } 60 | 61 | }) 62 | }, 63 | }; -------------------------------------------------------------------------------- /commands/Users/PauseUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("pause-user") 8 | .setDescription("Pause user") 9 | .addStringOption((option) => 10 | option 11 | .setName("user") 12 | .setDescription("The username of the user you'd like to pause.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let user = interaction.options.getString("user") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=pauseuser&username=${user}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Users/ResetAllUsers.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("reset-all-users") 8 | .setDescription("Reset all users HWID") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Reset all users HWID", 11 | "fi": "Nollaa kaikkien käyttäjien hwid", 12 | "fr": "Réinitialiser l'identifiant matériel de tous les utilisateurs", 13 | "de": "Setzen Sie die Hardware-ID aller Benutzer zurück", 14 | "it": "Reimposta l'ID hardware di tutti gli utenti", 15 | "nl": "Reset alle gebruikers hwid", 16 | "ru": "Сбросить идентификатор аппаратного обеспечения всех пользователей", 17 | "pl": "Zresetuj wszystkie identyfikatory sprzętu użytkowników", 18 | "tr": "Tüm kullanıcının donanım kimliğini sıfırlayın", 19 | "cs": "Obnovte identifikátor hardwaru všech uživatelů", 20 | "ja": "すべてのユーザーのハードウェアIDをリセットします", 21 | "ko": "모든 사용자의 하드웨어 ID를 재설정합니다", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 25 | let ephemeral = !interaction.guild ? false : true; 26 | 27 | let sellerkey = await db.get(`token_${idfrom}`) 28 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 29 | 30 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=resetalluser`) 31 | .then(res => res.json()) 32 | .then(json => { 33 | if (json.success) { 34 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 35 | } 36 | else { 37 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 38 | } 39 | }) 40 | }, 41 | }; -------------------------------------------------------------------------------- /commands/Users/ResetUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("reset-user") 8 | .setDescription("Reset a user HWID.") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Reset a users HWID.", 11 | "fi": "Nollaa käyttäjä", 12 | "fr": "Réinitialiser un utilisateur", 13 | "de": "Benutzer zurücksetzen", 14 | "it": "Reimposta un utente", 15 | "nl": "Reset een gebruiker", 16 | "ru": "Сбросить пользователя", 17 | "pl": "Zresetuj użytkownika", 18 | "tr": "Bir kullanıcıyı sıfırlayın", 19 | "cs": "Resetovat uživatele", 20 | "ja": "ユーザーをリセットする", 21 | "ko": "사용자를 재설정하십시오", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("username") 26 | .setDescription("Username of the user you're HWID resetting.") 27 | .setRequired(true) 28 | ), 29 | async execute(interaction) { 30 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 31 | let ephemeral = !interaction.guild ? false : true; 32 | 33 | let sellerkey = await db.get(`token_${idfrom}`) 34 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 35 | 36 | let un = interaction.options.getString("username") 37 | 38 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=resetuser&user=${un}`) 39 | .then(res => res.json()) 40 | .then(json => { 41 | if (json.success) { 42 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle('User HWID successfully reset!').addFields([{ name: 'Username:', value: `\`${un}\`` }]).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 43 | } 44 | else { 45 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 46 | } 47 | }) 48 | }, 49 | }; -------------------------------------------------------------------------------- /commands/Users/SetUserCooldown.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("set-user-cooldown") 8 | .setDescription("Set User's Cooldown") 9 | .addStringOption((option) => 10 | option 11 | .setName("user") 12 | .setDescription( 13 | "The username of the user you would like to apply the cooldown for.", 14 | ) 15 | .setRequired(true), 16 | ) 17 | .addIntegerOption((option) => 18 | option 19 | .setName("cooldown") 20 | .setDescription( 21 | "The duration of the cooldown in seconds. Default 120 seconds.", 22 | ) 23 | .setRequired(true), 24 | ), 25 | async execute(interaction) { 26 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 27 | let ephemeral = !interaction.guild ? false : true; 28 | 29 | let sellerkey = await db.get(`token_${idfrom}`); 30 | if (sellerkey === null) 31 | return interaction.editReply({ 32 | embeds: [ 33 | new EmbedBuilder() 34 | .setDescription( 35 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-applcation\`, then \`/set-application\` Commands First.`, 36 | ) 37 | .setColor(Colors.Red) 38 | .setTimestamp(), 39 | ], 40 | ephemeral: ephemeral, 41 | }); 42 | let user = interaction.options.getString("user"); 43 | let cooldown = interaction.options.getInteger("cooldown") || 120; 44 | 45 | fetch( 46 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=setcooldown&user=${user}&cooldown=${cooldown}`, 47 | ) 48 | .then((res) => res.json()) 49 | .then((json) => { 50 | if (json.success) { 51 | interaction.editReply({ 52 | embeds: [ 53 | new EmbedBuilder() 54 | .setTitle(json.message) 55 | .setColor(Colors.Blue) 56 | .setTimestamp(), 57 | ], 58 | ephemeral: ephemeral, 59 | }); 60 | } else { 61 | interaction.editReply({ 62 | embeds: [ 63 | new EmbedBuilder() 64 | .setTitle(json.message) 65 | .addFields([ 66 | { 67 | name: "Note:", 68 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 69 | }, 70 | ]) 71 | .setColor(Colors.Red) 72 | .setFooter({ text: "KeyAuth Discord Bot" }) 73 | .setTimestamp(), 74 | ], 75 | ephemeral: ephemeral, 76 | }); 77 | } 78 | }); 79 | }, 80 | }; 81 | -------------------------------------------------------------------------------- /commands/Users/Subtract.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("subtract") 8 | .setDescription("Subtract from user subscription,") 9 | .addStringOption((option) => 10 | option 11 | .setName("user") 12 | .setDescription("The username of the user you're subtracting time form.") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("sub") 18 | .setDescription("Their subscription name.") 19 | .setRequired(true) 20 | ) 21 | .addIntegerOption((option) => 22 | option 23 | .setName("seconds") 24 | .setDescription("Time to subtract from their subscription.") 25 | .setRequired(true) 26 | ), 27 | async execute(interaction) { 28 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 29 | let ephemeral = !interaction.guild ? false : true; 30 | 31 | let sellerkey = await db.get(`token_${idfrom}`) 32 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 33 | 34 | let user = interaction.options.getString("user") 35 | let sub = interaction.options.getString("sub") 36 | let seconds = interaction.options.getInteger("seconds") 37 | 38 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=subtract&user=${user}&sub=${sub}&seconds=${seconds}`) 39 | .then(res => res.json()) 40 | .then(json => { 41 | if (json.success) { 42 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 43 | } else { 44 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 45 | } 46 | 47 | }) 48 | }, 49 | }; -------------------------------------------------------------------------------- /commands/Users/UnPauseUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("unpause-user") 8 | .setDescription("Unpause user") 9 | .addStringOption((option) => 10 | option 11 | .setName("username") 12 | .setDescription("The username of the user you'd like to unpause.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let user = interaction.options.getString("username") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=unpauseuser&username=${user}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /commands/Users/UnbanUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("unban-user") 8 | .setDescription("Unban user") 9 | .addStringOption((option) => 10 | option 11 | .setName("username") 12 | .setDescription("The username of the user you'd like to unban.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let user = interaction.options.getString("username") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=unbanuser&user=${user}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 31 | } 32 | }) 33 | }, 34 | }; -------------------------------------------------------------------------------- /commands/Users/UserData.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("retrieve-user-data") 8 | .setDescription("Retrieve information about a user.") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Retrieve information about a user.", 11 | "fi": "Hae tietoja käyttäjältä", 12 | "fr": "Récupérer des informations sur un utilisateur", 13 | "de": "Informationen von einem Benutzer abrufen", 14 | "it": "Recupera informazioni da un utente", 15 | "nl": "Informatie ophalen van een gebruiker", 16 | "ru": "Получить информацию о пользователе", 17 | "pl": "Pobierz informacje o użytkowniku", 18 | "tr": "Bir kullanıcıdan bilgi al", 19 | "cs": "Získejte informace o uživateli", 20 | "ja": "ユーザーから情報を取得する", 21 | "ko": "사용자에서 정보 검색", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("user") 26 | .setDescription("Specify the user to lookup") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Specify the user to lookup", 29 | "fi": "Määritä käyttäjä, jota etsitään", 30 | "fr": "Spécifiez l'utilisateur à rechercher", 31 | "de": "Geben Sie den Benutzer an, nach dem gesucht werden soll", 32 | "it": "Specifica l'utente da cercare", 33 | "nl": "Geef de gebruiker op die u wilt opzoeken", 34 | "ru": "Укажите пользователя для поиска", 35 | "pl": "Określ użytkownika do wyszukania", 36 | "tr": "Aranacak kullanıcıyı belirtin", 37 | "cs": "Zadejte uživatele, kterého chcete vyhledat", 38 | "ja": "検索するユーザーを指定してください", 39 | "ko": "찾을 사용자 지정", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let user = interaction.options.getString("user") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=userdata&user=${user}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (!json.success) return interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 56 | let hwid = json.hwid ?? "N/A"; 57 | let ip = json.ip ?? "N/A"; 58 | let lastlogin = (json.lastlogin !== null && json.lastlogin !== undefined) ? `` : "N/A"; 59 | let expiry = "N/A"; 60 | let subscription = "N/A"; 61 | if (json.subscriptions.length !== 0) { 62 | expiry = (json.subscriptions[0].expiry !== null && json.subscriptions[0].expiry !== undefined) ? `` : "N/A"; 63 | subscription = (json.subscriptions[0].subscription !== null && json.subscriptions[0].subscription !== undefined) ? json.subscriptions[0].subscription : "N/A"; 64 | } 65 | 66 | const embed = new EmbedBuilder() 67 | .setTitle(`User data for ${user}`) 68 | .addFields([ 69 | { name: 'Expiry:', value: `${expiry}` }, 70 | { name: 'Subscription name:', value: `${subscription}` }, 71 | { name: 'Last Login:', value: `${lastlogin}` }, 72 | { name: 'HWID:', value: `${hwid}` }, 73 | { name: 'Created On:', value: `` }, 74 | { name: 'IP Address:', value: `${ip}` }, 75 | { name: 'Token:', value: `${json["token"]}` }, 76 | ]) 77 | .setColor(Colors.Blue) 78 | .setTimestamp() 79 | 80 | interaction.editReply({ embeds: [embed], ephemeral: ephemeral }) 81 | }) 82 | }, 83 | }; -------------------------------------------------------------------------------- /commands/Users/VerifyUser.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("verify-user") 8 | .setDescription("Verify the user exists.") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Verify the user exists.", 11 | "fi": "Tarkista, että käyttäjä on olemassa", 12 | "fr": "Vérifier que l'utilisateur existe", 13 | "de": "Überprüfen, ob Benutzer existiert", 14 | "it": "Verifica che l'utente esista", 15 | "nl": "Controleer of gebruiker bestaat", 16 | "ru": "Проверить, существует ли пользователь", 17 | "pl": "Sprawdź, czy użytkownik istnieje", 18 | "tr": "Kullanıcının olup olmadığını doğrulayın", 19 | "cs": "Ověřte, zda uživatel existuje", 20 | "ja": "ユーザーが存在することを確認します", 21 | "ko": "사용자가 존재하는지 확인하십시오", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("user") 26 | .setDescription("The username of the user you would like to check the existence of") 27 | .setDescriptionLocalizations({ 28 | "en-US": "The username of the user you would like to check the existence of", 29 | "fi": "Käyttäjän käyttäjätunnus, jonka olemassaolon haluat tarkistaa", 30 | "fr": "Nom d'utilisateur de l'utilisateur dont vous souhaitez vérifier l'existence", 31 | "de": "Benutzername des Benutzers, dessen Existenz Sie überprüfen möchten", 32 | "it": "Nome utente dell'utente di cui desideri verificare l'esistenza", 33 | "nl": "Gebruikersnaam van de gebruiker waarvan u de bestaande wilt controleren", 34 | "ru": "Имя пользователя пользователя, существование которого вы хотите проверить", 35 | "pl": "Nazwa użytkownika użytkownika, którego istnienie chcesz sprawdzić", 36 | "tr": "Varlığını kontrol etmek istediğiniz kullanıcının kullanıcı adı", 37 | "cs": "Uživatelské jméno uživatele, jehož existenci chcete ověřit", 38 | "ja": "存在を確認したいユーザーのユーザー名", 39 | "ko": "존재 여부를 확인하려는 사용자의 사용자 이름", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let user = interaction.options.getString("user") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=verifyuser&user=${user}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (json.success) { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'User exists:', value: `\`${user}\`` }]).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 57 | } 58 | else { 59 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 60 | } 61 | }) 62 | }, 63 | }; -------------------------------------------------------------------------------- /commands/Utilies/AddApplicationHash.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-application-hash") 8 | .setDescription("Add an additional hash to your application.") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Add an additional hash to your application.", 11 | "fi": "Lisää lisähash sovellukseesi", 12 | "fr": "Ajouter un hash supplémentaire à votre application", 13 | "de": "Fügen Sie Ihrer Anwendung einen zusätzlichen Hash hinzu", 14 | "it": "Aggiungi un hash aggiuntivo alla tua applicazione", 15 | "nl": "Voeg een extra hash toe aan uw aanvraag", 16 | "ru": "Добавьте дополнительный хэш к своему приложению", 17 | "pl": "Dodaj dodatkowy hash do swojej aplikacji", 18 | "tr": "Uygulamanıza ek hash ekleyin", 19 | "cs": "Přidejte do své aplikace další hash", 20 | "ja": "アプリケーションに追加のハッシュを追加します", 21 | "ko": "응용 프로그램에 추가 해시 추가", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("hash") 26 | .setDescription("The MD5 hash you want to add") 27 | .setDescriptionLocalizations({ 28 | "en-US": "The MD5 hash you want to add", 29 | "fi": "MD5-tiiviste, jonka haluat lisätä", 30 | "fr": "hachage MD5 que vous souhaitez ajouter", 31 | "de": "MD5-Hash, den Sie hinzufügen möchten", 32 | "it": "hash MD5 che si desidera aggiungere", 33 | "nl": "MD5-hash die u wilt toevoegen", 34 | "ru": "MD5-хэш, который вы хотите добавить", 35 | "pl": "MD5-hash, który chcesz dodać", 36 | "tr": "Eklemek istediğiniz MD5 karma", 37 | "cs": "MD5 hash, který chcete přidat", 38 | "ja": "追加したいMD5ハッシュ", 39 | "ko": "추가하려는 MD5 해시", 40 | }) 41 | .setRequired(true) 42 | ), 43 | async execute(interaction) { 44 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 45 | let ephemeral = !interaction.guild ? false : true; 46 | 47 | let sellerkey = await db.get(`token_${idfrom}`) 48 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 49 | 50 | let md5hash = interaction.options.getString("hash") 51 | 52 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=addhash&hash=${md5hash}`) 53 | .then(res => res.json()) 54 | .then(json => { 55 | if (json.success) { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 57 | } else { 58 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 59 | } 60 | }) 61 | }, 62 | }; -------------------------------------------------------------------------------- /commands/Utilies/AddHardwareId.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-hardwareid") 8 | .setDescription("Add HWID") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Add HWID", 11 | "fi": "Lisää HWID", 12 | "fr": "Ajouter HWID", 13 | "de": "HWID hinzufügen", 14 | "it": "Aggiungi HWID", 15 | "nl": "Voeg HWID toe", 16 | "ru": "Добавить HWID", 17 | "pl": "Dodaj HWID", 18 | "tr": "HWID ekle", 19 | "cs": "Přidat HWID", 20 | "ja": "HWIDを追加", 21 | "ko": "HWID 추가", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("username") 26 | .setDescription("Enter username") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Enter username", 29 | "fi": "Anna käyttäjätunnus", 30 | "fr": "Entrez le nom d'utilisateur", 31 | "de": "Geben Sie den Benutzernamen ein", 32 | "it": "Inserisci il nome utente", 33 | "nl": "Voer gebruikersnaam in", 34 | "ru": "Введите имя пользователя", 35 | "pl": "Wprowadź nazwę użytkownika", 36 | "tr": "Kullanıcı adını girin", 37 | "cs": "Zadejte uživatelské jméno", 38 | "ja": "ユーザー名を入力してください", 39 | "ko": "사용자 이름을 입력하십시오", 40 | }) 41 | .setRequired(true) 42 | ) 43 | .addStringOption((option) => 44 | option 45 | .setName("hwid") 46 | .setDescription("Enter additional HWID") 47 | .setDescriptionLocalizations({ 48 | "en-US": "Enter additional HWID", 49 | "fi": "Anna lisä HWID", 50 | "fr": "Entrez un HWID supplémentaire", 51 | "de": "Geben Sie zusätzliche HWID ein", 52 | "it": "Inserisci HWID aggiuntivo", 53 | "nl": "Voer extra HWID in", 54 | "ru": "Введите дополнительный HWID", 55 | "pl": "Wprowadź dodatkowy HWID", 56 | "tr": "Ek HWID girin", 57 | "cs": "Zadejte další HWID", 58 | "ja": "追加のHWIDを入力してください", 59 | "ko": "추가 HWID 입력", 60 | }) 61 | .setRequired(true) 62 | ), 63 | async execute(interaction) { 64 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 65 | let ephemeral = !interaction.guild ? false : true; 66 | 67 | let sellerkey = await db.get(`token_${idfrom}`) 68 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 69 | 70 | let un = interaction.options.getString("username") 71 | let auxhwid = interaction.options.getString("hwid") 72 | 73 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=addhwiduser&user=${un}&hwid=${auxhwid}`) 74 | .then(res => res.json()) 75 | .then(json => { 76 | if (json.success) { 77 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 78 | } else { 79 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setTimestamp().setFooter({ text: "KeyAuth Discord Bot" })], ephemeral: ephemeral }) 80 | } 81 | }) 82 | }, 83 | }; -------------------------------------------------------------------------------- /commands/Utilies/FetchApplicationStats.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("fetch-application-stats") 8 | .setDescription("Application statistics") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Application statistics", 11 | "fi": "Sovelluksen tilastot", 12 | "fr": "Statistiques de l'application", 13 | "de": "Anwendungsstatistiken", 14 | "it": "Statistiche dell'applicazione", 15 | "nl": "Applicatiestatistieken", 16 | "ru": "Статистика приложения", 17 | "pl": "Statystyki aplikacji", 18 | "tr": "Uygulama İstatistikleri", 19 | "cs": "Statistiky aplikace", 20 | "ja": "アプリケーションの統計", 21 | "ko": "응용 프로그램 통계", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 25 | let ephemeral = !interaction.guild ? false : true; 26 | 27 | let sellerkey = await db.get(`token_${idfrom}`) 28 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 29 | 30 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=stats`) 31 | .then(res => res.json()) 32 | .then(json => { 33 | if (json.success) { 34 | 35 | const embed = new EmbedBuilder() 36 | .setTitle('Application Statistics') 37 | .addFields([ 38 | { name: 'Total Keys:', value: `${json['totalkeys']}` }, 39 | { name: 'Unused Keys:', value: `${json['unused']}` }, 40 | { name: 'Used Keys:', value: `${json['used']}` }, 41 | { name: 'Paused Keys:', value: `${json['paused']}` }, 42 | { name: 'Banned Keys:', value: `${json['banned']}` }, 43 | { name: 'Webhooks:', value: `${json['webhooks']}` }, 44 | { name: 'Files:', value: `${json['files']}` }, 45 | { name: 'Vars:', value: `${json['vars']}` }, 46 | { name: 'Total Accounts:', value: `${json['totalaccs']}` }, 47 | { name: 'Reseller Accounts:', value: `${json['resellers']}` }, 48 | { name: 'Manager Accounts:', value: `${json['managers']}` }, 49 | ]) 50 | .setColor(Colors.Blue).setTimestamp() 51 | 52 | 53 | interaction.editReply({ embeds: [embed], ephemeral: ephemeral }) 54 | } 55 | else { 56 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 57 | } 58 | }) 59 | 60 | }, 61 | }; -------------------------------------------------------------------------------- /commands/Utilies/Help.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | 3 | module.exports = { 4 | data: new SlashCommandBuilder() 5 | .setName("help") 6 | .setDescription("Help command for bot.") 7 | .setDescriptionLocalizations({ 8 | "en-US": "Help command for bot.", 9 | "fi": "Ohje-komento bottia varten", 10 | "fr": "Commande d'aide pour le bot", 11 | "de": "Hilfsbefehl für den Bot", 12 | "it": "Comando di aiuto per il bot", 13 | "nl": "Helpcommando voor bot", 14 | "ru": "Команда справки для бота", 15 | "pl": "Polecenie pomocy dla bota", 16 | "tr": "Bot için yardım komutu", 17 | "cs": "Příkaz nápovědy pro bota", 18 | "ja": "ボットのヘルプコマンド", 19 | "ko": "봇의 도움말 명령", 20 | }), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | const embed = new EmbedBuilder() 26 | .setTitle(`KeyAuth help menu`) 27 | .addFields([ 28 | { name: '_ _', value: 'This bot is for the open-source authentication system [KeyAuth](https://keyauth.cc)\n\nIf you\'re using the cloud hosted version of KeyAuth, you\'ll need the seller plan to use. You can test before purchase by using the demo seller account in the #demo-accounts channel of the [Discord server](https://keyauth.cc/discord)' }, 29 | { name: 'Source code:', value: `[https://github.com/KeyAuth/KeyAuth-Discord-Bot](https://github.com/KeyAuth/KeyAuth-Discord-Bot)` }, 30 | { name: 'Library', value: "Discord.JS v14.14.1" }, 31 | { name: 'Tutorial video', value: '[https://www.youtube.com/watch?v=tngShw2Vmm0](https://www.youtube.com/watch?v=tngShw2Vmm0)' } 32 | ]) 33 | .setColor(Colors.Blue) 34 | .setTimestamp(); 35 | 36 | interaction.editReply({ embeds: [embed], ephemeral: ephemeral }) 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /commands/Utilies/ResetApplicationHash.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("reset-application-hash") 8 | .setDescription("Reset app hash") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Reset app hash", 11 | "fi": "Nollaa sovelluksen tunniste", 12 | "fr": "Réinitialiser l'empreinte de l'application", 13 | "de": "App-Hash zurücksetzen", 14 | "it": "Reimposta l'hash dell'app", 15 | "nl": "App-hash opnieuw instellen", 16 | "ru": "Сбросить хэш приложения", 17 | "pl": "Zresetuj hash aplikacji", 18 | "tr": "Uygulama karmaşasını sıfırla", 19 | "cs": "Obnovit hash aplikace", 20 | "ja": "アプリのハッシュをリセットする", 21 | "ko": "앱 해시 재설정", 22 | }), 23 | async execute(interaction) { 24 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 25 | let ephemeral = !interaction.guild ? false : true; 26 | 27 | let sellerkey = await db.get(`token_${idfrom}`) 28 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 29 | 30 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=resethash`) 31 | .then(res => res.json()) 32 | .then(json => { 33 | if (json.success) { 34 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle('Hash Successfully Reset!').addFields([{ name: 'Reminder:', value: `You need to reset hash each time you compile loader.` }]).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 35 | } 36 | else { 37 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 38 | } 39 | }) 40 | }, 41 | }; -------------------------------------------------------------------------------- /commands/Variables/DeleteAllVariables.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-variables") 8 | .setDescription("Delete all variables"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delallvars`) 17 | .then(res => res.json()) 18 | .then(json => { 19 | if (json.success) { 20 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 21 | } else { 22 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 23 | } 24 | 25 | }) 26 | }, 27 | }; -------------------------------------------------------------------------------- /commands/Variables/DeleteVariable.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-variable") 8 | .setDescription("Delete variable") 9 | .addStringOption((option) => 10 | option 11 | .setName("name") 12 | .setDescription("The variable name you would like to delete.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let name = interaction.options.getString("name") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delvar&name=${name}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | }) 33 | }, 34 | }; -------------------------------------------------------------------------------- /commands/Variables/EditVariable.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("edit-variable") 8 | .setDescription("Edit variable") 9 | .setDescriptionLocalizations({ 10 | "en-US": "Edit Variable", 11 | "fi": "Muokkaa muuttujaa", 12 | "fr": "Modifier la variable", 13 | "de": "Variable bearbeiten", 14 | "it": "Modifica variabile", 15 | "nl": "Variabele bewerken", 16 | "ru": "Изменить переменную", 17 | "pl": "Edytuj zmienną", 18 | "tr": "Değişkeni düzenle", 19 | "cs": "Upravit proměnnou", 20 | "ja": "変数を編集する", 21 | "ko": "변수 편집", 22 | }) 23 | .addStringOption((option) => 24 | option 25 | .setName("name") 26 | .setDescription("Variable Name?") 27 | .setDescriptionLocalizations({ 28 | "en-US": "Variable Name?", 29 | "fi": "Muuttujan nimi?", 30 | "fr": "Nom de la variable?", 31 | "de": "Variablenname?", 32 | "it": "Nome della variabile?", 33 | "nl": "Variabelenaam?", 34 | "ru": "Имя переменной?", 35 | "pl": "Nazwa zmiennej?", 36 | "tr": "Değişken adı?", 37 | "cs": "Název proměnné?", 38 | "ja": "変数名?", 39 | "ko": "변수 이름?", 40 | }) 41 | .setRequired(true) 42 | ) 43 | .addStringOption((option) => 44 | option 45 | .setName("value") 46 | .setDescription("Variable Value?") 47 | .setDescriptionLocalizations({ 48 | "en-US": "Variable Value?", 49 | "fi": "Muuttujan arvo?", 50 | "fr": "Valeur de la variable?", 51 | "de": "Variablenwert?", 52 | "it": "Valore della variabile?", 53 | "nl": "Variabele waarde?", 54 | "ru": "Значение переменной?", 55 | "pl": "Wartość zmiennej?", 56 | "tr": "Değişken değeri?", 57 | "cs": "Hodnota proměnné?", 58 | "ja": "変数の値?", 59 | "ko": "변수 값?", 60 | }) 61 | .setRequired(true) 62 | ), 63 | async execute(interaction) { 64 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 65 | let ephemeral = !interaction.guild ? false : true; 66 | 67 | let sellerkey = await db.get(`token_${idfrom}`) 68 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 69 | 70 | let varname = interaction.options.getString("name") 71 | let varvalue = interaction.options.getString("value") 72 | 73 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=editvar&varid=${varname}&data=${varvalue}`) 74 | .then(res => res.json()) 75 | .then(json => { 76 | if (json.success) { 77 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Green).setTimestamp()], ephemeral: ephemeral }) 78 | } else { 79 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 80 | } 81 | }) 82 | }, 83 | }; -------------------------------------------------------------------------------- /commands/Variables/MassDeleteUserVariables.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require("../../utils/database"); 3 | const fetch = require("node-fetch"); 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("mass-delete-user-variables") 8 | .setDescription("Delete All User Variables With Name") 9 | .addStringOption((option) => 10 | option 11 | .setName("name") 12 | .setDescription("The name of the subscription.") 13 | .setRequired(true), 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`); 20 | if (sellerkey === null) 21 | return interaction.editReply({ 22 | embeds: [ 23 | new EmbedBuilder() 24 | .setDescription( 25 | `Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`, 26 | ) 27 | .setColor(Colors.Red) 28 | .setTimestamp(), 29 | ], 30 | ephemeral: ephemeral, 31 | }); 32 | 33 | let name = interaction.options.getString("name"); 34 | 35 | fetch( 36 | `https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=massUserVarDelete&name=${name}`, 37 | ) 38 | .then((res) => res.json()) 39 | .then((json) => { 40 | if (json.success) { 41 | interaction.editReply({ 42 | embeds: [ 43 | new EmbedBuilder() 44 | .setTitle(json.message) 45 | .addFields([ 46 | { name: "User variable deleted:", value: `\`${name}\`` }, 47 | ]) 48 | .setColor(Colors.Green) 49 | .setTimestamp(), 50 | ], 51 | ephemeral: ephemeral, 52 | }); 53 | } else { 54 | interaction.editReply({ 55 | embeds: [ 56 | new EmbedBuilder() 57 | .setTitle(json.message) 58 | .addFields([ 59 | { 60 | name: "Note:", 61 | value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.`, 62 | }, 63 | ]) 64 | .setColor(Colors.Red) 65 | .setTimestamp(), 66 | ], 67 | ephemeral: ephemeral, 68 | }); 69 | } 70 | }); 71 | }, 72 | }; 73 | -------------------------------------------------------------------------------- /commands/Variables/RetrieveVariableByName.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("retrieve-variable") 8 | .setDescription("Retrieve variable") 9 | .addStringOption((option) => 10 | option 11 | .setName("name") 12 | .setDescription("The variable name you would like to retrieve.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let name = interaction.options.getString("name") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=retrvvar&name=${name}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle("Content of Variable: " + json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/WebLoader/AddButton.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-webloader-button") 8 | .setDescription("Create new web loader button") 9 | .addStringOption((option) => 10 | option 11 | .setName("value") 12 | .setDescription("The value of the web loader button") 13 | .setRequired(true) 14 | ) 15 | .addStringOption((option) => 16 | option 17 | .setName("text") 18 | .setDescription("The text for the web loader button.") 19 | .setRequired(true) 20 | ), 21 | async execute(interaction) { 22 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 23 | let ephemeral = !interaction.guild ? false : true; 24 | 25 | let sellerkey = await db.get(`token_${idfrom}`) 26 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 27 | 28 | let value = interaction.options.getString("value") 29 | let text = interaction.options.getString("text") 30 | 31 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=addbutton&value=${value}&text=${text}`) 32 | .then(res => res.json()) 33 | .then(json => { 34 | if (json.success) { 35 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 36 | } else { 37 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 38 | } 39 | 40 | }) 41 | }, 42 | }; -------------------------------------------------------------------------------- /commands/WebLoader/DeleteAllButtons.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("del-all-webloader-buttons") 8 | .setDescription("Delete all web loader buttons"), 9 | 10 | async execute(interaction) { 11 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 12 | let ephemeral = !interaction.guild ? false : true; 13 | 14 | let sellerkey = await db.get(`token_${idfrom}`) 15 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 16 | 17 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delallbuttons`) 18 | .then(res => res.json()) 19 | .then(json => { 20 | if (json.success) { 21 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 22 | } else { 23 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 24 | } 25 | 26 | }) 27 | }, 28 | }; -------------------------------------------------------------------------------- /commands/WebLoader/DeleteButton.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("del-webloader-button") 8 | .setDescription("Delete web loader button") 9 | .addStringOption((option) => 10 | option 11 | .setName("value") 12 | .setDescription("The value of the web loader button") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let value = interaction.options.getString("value") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delbutton&value=${value}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Webhooks/DeleteAllWebhooks.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-webhooks") 8 | .setDescription("Delete all webhooks"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delallwebhooks`) 17 | .then(res => res.json()) 18 | .then(json => { 19 | if (json.success) { 20 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 21 | } else { 22 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 23 | } 24 | 25 | }) 26 | }, 27 | }; -------------------------------------------------------------------------------- /commands/Webhooks/DeleteWebhook.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-webhook") 8 | .setDescription("Delete a webhook") 9 | .addStringOption((option) => 10 | option 11 | .setName("webhookid") 12 | .setDescription("The webhook id you want to delete") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let webhook = interaction.options.getString("webhookid") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delwebhook&webid=${webhook}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Whitelists/AddWhitelist.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("add-whitelist") 8 | .setDescription("Delete existing whitelist") 9 | .addStringOption((option) => 10 | option 11 | .setName("ip") 12 | .setDescription("The IP you would like to delete from the whitelist.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let ip = interaction.options.getString("ip") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=addWhite&ip=${ip}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | 33 | }) 34 | }, 35 | }; -------------------------------------------------------------------------------- /commands/Whitelists/DeleteAllWhitelists.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-all-whitelists") 8 | .setDescription("Delete all whitelists"), 9 | async execute(interaction) { 10 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 11 | let ephemeral = !interaction.guild ? false : true; 12 | 13 | let sellerkey = await db.get(`token_${idfrom}`) 14 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 15 | 16 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delallwhites`) 17 | .then(res => res.json()) 18 | .then(json => { 19 | if (json.success) { 20 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 21 | } else { 22 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 23 | } 24 | }) 25 | }, 26 | }; -------------------------------------------------------------------------------- /commands/Whitelists/DeleteWhitelist.js: -------------------------------------------------------------------------------- 1 | const { SlashCommandBuilder, Colors, EmbedBuilder } = require("discord.js"); 2 | const db = require('../../utils/database') 3 | const fetch = require('node-fetch') 4 | 5 | module.exports = { 6 | data: new SlashCommandBuilder() 7 | .setName("delete-whitelist") 8 | .setDescription("Delete existing whitelist") 9 | .addStringOption((option) => 10 | option 11 | .setName("ip") 12 | .setDescription("The IP you would like to delete from the whitelist.") 13 | .setRequired(true) 14 | ), 15 | async execute(interaction) { 16 | let idfrom = interaction.guild ? interaction.guild.id : interaction.user.id; 17 | let ephemeral = !interaction.guild ? false : true; 18 | 19 | let sellerkey = await db.get(`token_${idfrom}`) 20 | if (sellerkey === null) return interaction.editReply({ embeds: [new EmbedBuilder().setDescription(`Your \`SellerKey\` **has not been set!**\n In order to use this bot, you must run the \`/add-application\` Command First.`).setColor(Colors.Red).setTimestamp()], ephemeral: ephemeral }) 21 | 22 | let ip = interaction.options.getString("ip") 23 | 24 | fetch(`https://keyauth.win/api/seller/?sellerkey=${sellerkey}&type=delWhite&ip=${ip}`) 25 | .then(res => res.json()) 26 | .then(json => { 27 | if (json.success) { 28 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).setColor(Colors.Blue).setTimestamp()], ephemeral: ephemeral }) 29 | } else { 30 | interaction.editReply({ embeds: [new EmbedBuilder().setTitle(json.message).addFields([{ name: 'Note:', value: `Your seller key is most likely invalid. Change your seller key with \`/add-application\` command.` }]).setColor(Colors.Red).setFooter({ text: "KeyAuth Discord Bot" }).setTimestamp()], ephemeral: ephemeral }) 31 | } 32 | }) 33 | }, 34 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "better-sqlite3": "^9.2.2", 4 | "discord.js": "^14.14.1", 5 | "dotenv": "^16.3.1", 6 | "fs": "^0.0.1-security", 7 | "node-fetch": "^2.7.0", 8 | "quick.db": "^9.1.7" 9 | }, 10 | "name": "keyauth_discord_bot", 11 | "version": "3.0.0", 12 | "description": "KeyAuth Authentication SellerAPI Discord Bot", 13 | "main": "index.js", 14 | "scripts": { 15 | "test": "/help", 16 | "start": "node index.js" 17 | }, 18 | "engines": { 19 | "node": ">=20.0.0" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/keyauth/keyauth-Discord-Bot.git" 24 | }, 25 | "keywords": [ 26 | "keyauth", 27 | "sellerapi", 28 | "discordjs14" 29 | ], 30 | "author": "keyauth, mazkdevf ", 31 | "license": "ISC", 32 | "bugs": { 33 | "url": "https://github.com/keyauth/keyauth-Discord-Bot/issues" 34 | }, 35 | "homepage": "https://github.com/keyauth/keyauth-Discord-Bot#readme" 36 | } 37 | -------------------------------------------------------------------------------- /utils/config.js: -------------------------------------------------------------------------------- 1 | const dotenv = require("dotenv"); 2 | dotenv.config(); 3 | 4 | const { TOKEN, DEVELOPMENT_SERVER_ID, TYPE } = process.env; 5 | 6 | if (!TOKEN || !DEVELOPMENT_SERVER_ID || !TYPE) { 7 | throw new Error("Missing required environment variables: TOKEN, DEVELOPMENT_SERVER_ID, TYPE"); 8 | } 9 | 10 | const config = { 11 | token: TOKEN, 12 | DevelopmentServerId: DEVELOPMENT_SERVER_ID, 13 | type: TYPE || "development" 14 | }; 15 | 16 | if (config.type !== "production" && !config.DevelopmentServerId) { 17 | throw new Error("Missing Development Server Id!"); 18 | } 19 | 20 | module.exports = config; -------------------------------------------------------------------------------- /utils/database.js: -------------------------------------------------------------------------------- 1 | // This file is used to create a database instance for the bot to use. 2 | const { QuickDB } = require("quick.db"); 3 | const db = new QuickDB(); 4 | module.exports = db; --------------------------------------------------------------------------------