Skip to content

Instantly share code, notes, and snippets.

@savely-krasovsky
Forked from fipso/score.js
Last active October 16, 2023 13:07
Show Gist options
  • Save savely-krasovsky/35c549b0256b3c827f52cd44fec8530d to your computer and use it in GitHub Desktop.
Save savely-krasovsky/35c549b0256b3c827f52cd44fec8530d to your computer and use it in GitHub Desktop.
Gamee Hacker Bot for Telegram
/**
* 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);
});
@oakrom
Copy link

oakrom commented Feb 13, 2019

Hi!, How do use this code?

@Otacon222
Copy link

Salut!
Comment vous allez?
svp Comment utiliser ce bot pour gamee dernière version?

@Otacon222
Copy link

Gamee prizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment