auth.gg
Version:
Bot Discord Auth.gg
169 lines (101 loc) • 4.31 kB
JavaScript
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 + "new-hwid")){
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}` === `${language4.noexiste}`)
{
message.channel.send(`\> ${message.author}, ${language4.text1} ${emoji.no}...`)
}
else if(`${res.data.info}` === `${language4.noappli}`)
{
message.channel.send(`\> ${message.author}, ${language4.errorapp} ${emoji.no}...\n${language4.contact} <@${IDOWNER}> !`)
}
else if(`${res.data.status}` === "success")
{
if(`${res.data.username} === ${message.author.id}`)
{
//===============================
get(`https://developers.auth.gg/HWID/?type=reset&authorization=${API}&user=${message.author.id}`, {
headers: {
'Content-Type': "application/json",
}
}).then( (res) => {
//-----------------------------//
// STATS //
//-----------------------------//
if(`${res.data.info}` === "HWID has been succesfully reset")
{
message.channel.send(`\> ${message.author}, ${language4.good}`);
}
else
{
message.channel.send(`\>${language4.errorinco} ${emoji.no}`);
}
}).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.