end credits self care + remove quotes in config

This commit is contained in:
ChomeNS 2022-11-27 13:16:49 +07:00
parent 6ea46cff2a
commit 37f88488f6
3 changed files with 48 additions and 47 deletions

4
bot.js
View file

@ -167,10 +167,6 @@ async function createBot(server, config, getBots, setNewBot, dcclient, rl) {
bot.write('keep_alive', {keepAliveId: packet.keepAliveId}); bot.write('keep_alive', {keepAliveId: packet.keepAliveId});
}); });
bot._client.on('game_state_change', () => {
bot.write('client_command', {payload: 0});
});
bot._client.on('kick_disconnect', function(data) { bot._client.on('kick_disconnect', function(data) {
const parsed = JSON.parse(data.reason); const parsed = JSON.parse(data.reason);
bot.end(parsed, 'kick_disconnect'); bot.end(parsed, 'kick_disconnect');

View file

@ -1,22 +1,22 @@
/* eslint-disable max-len */ /* eslint-disable max-len */
module.exports = { module.exports = {
'version': '1.18.2', version: '1.18.2',
'prefixes': [ prefixes: [
'*', '*',
'cbot ', 'cbot ',
'/cbot ', '/cbot ',
], ],
'commandsDir': '../commands', // this will be used by the commands.js in the plugins folder so it needs ../ commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
'keys': { keys: {
'normalKey': '<27>iB_D<5F><44><EFBFBD>k<EFBFBD><6B>j8H<38>{?[/ڭ<>f<EFBFBD><>^-=<3D>Ț<EFBFBD><C89A>v]<5D><>g><3E><>=c', normalKey: '<27>iB_D<5F><44><EFBFBD>k<EFBFBD><6B>j8H<38>{?[/ڭ<>f<EFBFBD><>^-=<3D>Ț<EFBFBD><C89A>v]<5D><>g><3E><>=c',
'ownerHashKey': 'b)R<><52>nF<6E>CW<43><57><EFBFBD>#<23>\\[<5B>S*8"t^eia<69>Z<EFBFBD><5A>k<EFBFBD><6B><EFBFBD><EFBFBD>K1<4B>8zȢ<7A>', ownerHashKey: 'b)R<><52>nF<6E>CW<43><57><EFBFBD>#<23>\\[<5B>S*8"t^eia<69>Z<EFBFBD><5A>k<EFBFBD><6B><EFBFBD><EFBFBD>K1<4B>8zȢ<7A>',
}, },
'console': true, console: true,
'useChat': false, useChat: false,
'core': { core: {
'layers': 3, layers: 3,
'refillInterval': 1000 * 60, refillInterval: 1000 * 60,
'customName': [ customName: [
{ {
text: 'ChomeNS Bot ', text: 'ChomeNS Bot ',
color: 'yellow', color: 'yellow',
@ -27,22 +27,23 @@ module.exports = {
}, },
], ],
}, },
'self_care': { self_care: {
'prefix': true, prefix: true,
'op': true, op: true,
'cspy': true, cspy: true,
'vanish': true, vanish: true,
'gamemode': true, gamemode: true,
'mute': true, mute: true,
endCredits: true,
}, },
'eval': { eval: {
'serverUrl': 'http://192.168.1.105:4445/', serverUrl: 'http://192.168.1.105:4445/',
}, },
'reconnectTimeout': 1000 * 2, reconnectTimeout: 1000 * 2,
'self_care_check_interval': 2000, self_care_check_interval: 2000,
'discord': { discord: {
'token': 'OTcxNjUwNDU2NzA5Mzk4NTY5.G3lKC2._XQNTTU1Jqmaam_A0JKSe93GP1vFZvDpiXqZzA', token: 'OTcxNjUwNDU2NzA5Mzk4NTY5.G3lKC2._XQNTTU1Jqmaam_A0JKSe93GP1vFZvDpiXqZzA',
'servers': { servers: {
'sus.shhnowisnottheti.me': '990140129245020221', 'sus.shhnowisnottheti.me': '990140129245020221',
'play.kaboom.pw': '1000355361196355674', 'play.kaboom.pw': '1000355361196355674',
'129.159.58.114': '998945155316973650', '129.159.58.114': '998945155316973650',
@ -51,33 +52,33 @@ module.exports = {
'mc.chomens41793.ga': '1010734897796763758', 'mc.chomens41793.ga': '1010734897796763758',
'real.chipmunk.land': '1042590315464364032', 'real.chipmunk.land': '1042590315464364032',
}, },
'prefix': '!', prefix: '!',
}, },
'servers': [ servers: [
{ {
'host': 'play.kaboom.pw', host: 'play.kaboom.pw',
'port': 25565, port: 25565,
'kaboom': true, kaboom: true,
}, },
{ {
'host': 'sus.shhnowisnottheti.me', host: 'sus.shhnowisnottheti.me',
'port': 25565, port: 25565,
'kaboom': true, kaboom: true,
}, },
{ {
'host': 'kitsune.icu', host: 'kitsune.icu',
'port': 25565, port: 25565,
'kaboom': true, kaboom: true,
}, },
{ {
'host': 'real.chipmunk.land', host: 'real.chipmunk.land',
'port': 25565, port: 25565,
'kaboom': true, kaboom: true,
}, },
{ {
'host': 'mc.chomens41793.ga', host: 'mc.chomens41793.ga',
'port': 25565, port: 25565,
'kaboom': true, kaboom: true,
}, },
], ],
}; };

View file

@ -7,6 +7,7 @@ function inject(bot, dcclient, config) {
let gameMode = 1; let gameMode = 1;
let prefix = false; let prefix = false;
let muted = false; let muted = false;
let endCredits = false;
bot.on('parsed_chat', (data) => { bot.on('parsed_chat', (data) => {
if (data.toString() === 'You are now completely invisible to normal users, and hidden from in-game commands.') vanish = true; if (data.toString() === 'You are now completely invisible to normal users, and hidden from in-game commands.') vanish = true;
@ -46,6 +47,8 @@ function inject(bot, dcclient, config) {
}); });
bot._client.on('game_state_change', (data) => { bot._client.on('game_state_change', (data) => {
if (data.reason === 4) endCredits = true;
if (data.reason !== 3) return; if (data.reason !== 3) return;
gameMode = data.gameMode; gameMode = data.gameMode;
@ -64,6 +67,7 @@ function inject(bot, dcclient, config) {
if (!vanish && config.self_care.vanish) bot.chat('/essentials:vanish enable'); if (!vanish && config.self_care.vanish) bot.chat('/essentials:vanish enable');
if (gameMode !== 1 && config.self_care.gamemode) bot.chat('/minecraft:gamemode creative @s[type=player]'); if (gameMode !== 1 && config.self_care.gamemode) bot.chat('/minecraft:gamemode creative @s[type=player]');
if (muted && config.self_care.mute) bot.chat('/essentials:mute ' + bot.uuid); if (muted && config.self_care.mute) bot.chat('/essentials:mute ' + bot.uuid);
if (endCredits && config.self_care.endCredits) bot.write('client_command', {payload: 0});
}, config.self_care_check_interval); }, config.self_care_check_interval);
bot.once('end', () => { bot.once('end', () => {