UNPKG

auth.gg

Version:
185 lines (116 loc) 5.35 kB
const REDEEM = require("discord.js"); const client = new REDEEM.Client(); const get = require('axios'); const mysql = require('mysql'); var req = require("request"); ///////////// CONFIG VARIABLES BOT ---> END ///////////////////// const nbr1 = 10 // Nombre de caractere attribué au mot de passe quand [redeem] :) const prefix = "+"; // CHOIX DU PREFIX :) const OWNER = "OldModz95#7213" ///////////// CONFIG VARIABLES ---> END ///////////////////// ////////////////////// AUTH.GG ---> START ////////////////////////////// var aid = ""; // AID AUTH.GG var secret = ""; // SECRETKEY AUTH.GG var apikey = ""; // APIKEY AUTH.GG const API = ""; // API FREE (REGLAGE DE L'API AUTH.GG POUR GERER L'APP DEPUIS DISCORD) :) ////////////////////// AUTH.GG ---> END ////////////////////////////// client.on('ready',() => { console.log(`- ${client.user.tag} prêt a être utilisé ...\n`) }); client.on('message', async function(message) { //------------------------------------ if(message.content.startsWith(prefix + "forgot")){ message.delete(message.author); //---------------------------------------- // Lien API get(`https://developers.auth.gg/USERS/?type=fetch&authorization=${API}&user=${message.author.id}`, { headers: { 'Content-Type': "application/json", } }).then( (res) => { //-----------------------------// // STATS // //-----------------------------// try { // Si elle n'existe pas if(`${res.data.info}` === "No user found") { message.channel.send(`\> ${message.author}, nous avons trouvé aucun compte à vous <a:no:858077944455233536>...`) } else if(`${res.data.info}` === "No application found") { message.channel.send(`\> ${message.author}, Erreur de l'application <a:no:858077944455233536>...\nMerci de contacter <@${IDOWNER}> !`) } else if(`${res.data.status}` === "success") { function makeid(length) { var result = []; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-@=+!:.;?'; var charactersLength = characters.length; for ( var i = 0; i < length; i++ ) { result.push(characters.charAt(Math.floor(Math.random() * charactersLength))); } return result.join(''); } const newpassword = (makeid(nbr1)) // Stockage du mdp dans une variable if(`${res.data.username} === ${message.author.id}`) { //=============================== get(`https://developers.auth.gg/USERS/?type=changepw&authorization=${API}&user=${message.author.id}&password=${newpassword}`, { headers: { 'Content-Type': "application/json", } }).then( (res) => { //-----------------------------// // STATS // //-----------------------------// if(`${res.data.info} === "Password has been updated"`) { message.channel.send(`\> ${message.author}, Votre nouveau mot de passe vous a étais envoyer en message priver.`); message.author.createDM().then(channel => { channel.send(`**_T'es information d'utilisateur :__** \n\n\> Username : \`\`${message.author.id}\`\` \n\> Password : \`\`${passwordsuper}\`\` \n\n Si vous avez une question contacter ${OWNER}!`) }) } else { message.channel.send(`\>Erreur inconnu est survenu.`); } }).catch ((error) => { console.log(res.data) }) //=============================== } //----------- } //----- }//--Fin du TRY //----- //----- catch(error) { console.log(res.data) } //------ }) } // // Fin de la commandes // ///////////////////////////////////////////////////////////////////////// }) client.login(""); //Developed By OldModz95#7213 // https://discord.gg/3t2568W //====CREDIT==== // System Button created by AngeloCore // https://www.npmjs.com/package/discord-buttons // System Button nuggies by Nuggies-bot //https://github.com/Nuggies-bot/nuggies-npm //https://www.npmjs.com/package/nuggies //============ // La base des plugins ont étais développer par leur créateur. // J'ai apporté beaucoup de modification par apport au bot que je voulais faire. // The basis of the plugins were developed by their creator. // I made a lot of changes for the bot I wanted to do.