-
-
Save savely-krasovsky/35c549b0256b3c827f52cd44fec8530d to your computer and use it in GitHub Desktop.
Gamee Hacker Bot for Telegram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by fipso on 13.10.16. | |
*/ | |
const CryptoJS = require('crypto-js'); | |
const request = require('request-promise-native'); | |
const TelegramBot = require('node-telegram-bot-api'); | |
const bot = new TelegramBot('TOKEN', {polling: true}); | |
const CryptoJSAesJson = { | |
stringify: function (cipherParams) { | |
const j = {ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64)}; | |
if (cipherParams.iv) j.iv = cipherParams.iv.toString(); | |
if (cipherParams.salt) j.s = cipherParams.salt.toString(); | |
return JSON.stringify(j); | |
}, | |
parse: function (jsonStr) { | |
const j = JSON.parse(jsonStr); | |
const cipherParams = CryptoJS.lib.CipherParams.create({ciphertext: CryptoJS.enc.Base64.parse(j.ct)}); | |
if (j.iv) cipherParams.iv = CryptoJS.enc.Hex.parse(j.iv); | |
if (j.s) cipherParams.salt = CryptoJS.enc.Hex.parse(j.s); | |
return cipherParams; | |
} | |
}; | |
function build(score, url) { | |
const timestamp = new Date().getTime(); | |
const hash = CryptoJS.AES.encrypt(JSON.stringify({ | |
score: score, | |
timestamp: timestamp | |
}), "crmjbjm3lczhlgnek9uaxz2l9svlfjw14npauhen", { | |
format: CryptoJSAesJson | |
}).toString(); | |
const sData = JSON.stringify({ | |
score: score, | |
url: "/game/" + url, | |
play_time: 20, | |
hash: hash | |
}); | |
return sData; | |
} | |
bot.on('text', function (msg) { | |
if (/^\/start/.exec(msg.text)) | |
bot.sendMessage(msg.chat.id, 'Send desired score and link of @gamee game. For example:\n' + | |
'<pre>100 ' + | |
'https://www.gameeapp.com/game/GAMECODE~telegram:inline~0000000000000000000~00000000~Name~Some_Hash</pre>' + | |
'\n\nBot by @kraso', | |
{parse_mode: 'HTML'}); | |
else { | |
const info = msg.text.split(' '); | |
const score = info[0]; | |
const url = /game\/(.+)#tg/.exec(info[1])[1]; | |
request.post({ | |
url: 'https://bots.gameeapp.com/set-web-score-qkfnsog26w7173c9pk7whg0iau7zwhdkfd7ft3tn', | |
body: build(score, url) | |
}) | |
.then(function (res) { | |
console.log(res); | |
bot.sendMessage(msg.chat.id, 'Done!'); | |
}) | |
.catch(function (err) { | |
console.warn(err); | |
bot.sendMessage(msg.chat.id, 'Something go wrong...'); | |
}); | |
} | |
}); | |
bot.on('message', function (msg) { | |
console.log(msg); | |
}); |
Salut!
Comment vous allez?
svp Comment utiliser ce bot pour gamee dernière version?
Gamee prizes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!, How do use this code?