mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
end credits self care + remove quotes in config
This commit is contained in:
parent
6ea46cff2a
commit
37f88488f6
3 changed files with 48 additions and 47 deletions
4
bot.js
4
bot.js
|
@ -167,10 +167,6 @@ async function createBot(server, config, getBots, setNewBot, dcclient, rl) {
|
|||
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) {
|
||||
const parsed = JSON.parse(data.reason);
|
||||
bot.end(parsed, 'kick_disconnect');
|
||||
|
|
87
config.js
87
config.js
|
@ -1,22 +1,22 @@
|
|||
/* eslint-disable max-len */
|
||||
module.exports = {
|
||||
'version': '1.18.2',
|
||||
'prefixes': [
|
||||
version: '1.18.2',
|
||||
prefixes: [
|
||||
'*',
|
||||
'cbot ',
|
||||
'/cbot ',
|
||||
],
|
||||
'commandsDir': '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
|
||||
'keys': {
|
||||
'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>',
|
||||
commandsDir: '../commands', // this will be used by the commands.js in the plugins folder so it needs ../
|
||||
keys: {
|
||||
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>',
|
||||
},
|
||||
'console': true,
|
||||
'useChat': false,
|
||||
'core': {
|
||||
'layers': 3,
|
||||
'refillInterval': 1000 * 60,
|
||||
'customName': [
|
||||
console: true,
|
||||
useChat: false,
|
||||
core: {
|
||||
layers: 3,
|
||||
refillInterval: 1000 * 60,
|
||||
customName: [
|
||||
{
|
||||
text: 'ChomeNS Bot ',
|
||||
color: 'yellow',
|
||||
|
@ -27,22 +27,23 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'self_care': {
|
||||
'prefix': true,
|
||||
'op': true,
|
||||
'cspy': true,
|
||||
'vanish': true,
|
||||
'gamemode': true,
|
||||
'mute': true,
|
||||
self_care: {
|
||||
prefix: true,
|
||||
op: true,
|
||||
cspy: true,
|
||||
vanish: true,
|
||||
gamemode: true,
|
||||
mute: true,
|
||||
endCredits: true,
|
||||
},
|
||||
'eval': {
|
||||
'serverUrl': 'http://192.168.1.105:4445/',
|
||||
eval: {
|
||||
serverUrl: 'http://192.168.1.105:4445/',
|
||||
},
|
||||
'reconnectTimeout': 1000 * 2,
|
||||
'self_care_check_interval': 2000,
|
||||
'discord': {
|
||||
'token': 'OTcxNjUwNDU2NzA5Mzk4NTY5.G3lKC2._XQNTTU1Jqmaam_A0JKSe93GP1vFZvDpiXqZzA',
|
||||
'servers': {
|
||||
reconnectTimeout: 1000 * 2,
|
||||
self_care_check_interval: 2000,
|
||||
discord: {
|
||||
token: 'OTcxNjUwNDU2NzA5Mzk4NTY5.G3lKC2._XQNTTU1Jqmaam_A0JKSe93GP1vFZvDpiXqZzA',
|
||||
servers: {
|
||||
'sus.shhnowisnottheti.me': '990140129245020221',
|
||||
'play.kaboom.pw': '1000355361196355674',
|
||||
'129.159.58.114': '998945155316973650',
|
||||
|
@ -51,33 +52,33 @@ module.exports = {
|
|||
'mc.chomens41793.ga': '1010734897796763758',
|
||||
'real.chipmunk.land': '1042590315464364032',
|
||||
},
|
||||
'prefix': '!',
|
||||
prefix: '!',
|
||||
},
|
||||
'servers': [
|
||||
servers: [
|
||||
{
|
||||
'host': 'play.kaboom.pw',
|
||||
'port': 25565,
|
||||
'kaboom': true,
|
||||
host: 'play.kaboom.pw',
|
||||
port: 25565,
|
||||
kaboom: true,
|
||||
},
|
||||
{
|
||||
'host': 'sus.shhnowisnottheti.me',
|
||||
'port': 25565,
|
||||
'kaboom': true,
|
||||
host: 'sus.shhnowisnottheti.me',
|
||||
port: 25565,
|
||||
kaboom: true,
|
||||
},
|
||||
{
|
||||
'host': 'kitsune.icu',
|
||||
'port': 25565,
|
||||
'kaboom': true,
|
||||
host: 'kitsune.icu',
|
||||
port: 25565,
|
||||
kaboom: true,
|
||||
},
|
||||
{
|
||||
'host': 'real.chipmunk.land',
|
||||
'port': 25565,
|
||||
'kaboom': true,
|
||||
host: 'real.chipmunk.land',
|
||||
port: 25565,
|
||||
kaboom: true,
|
||||
},
|
||||
{
|
||||
'host': 'mc.chomens41793.ga',
|
||||
'port': 25565,
|
||||
'kaboom': true,
|
||||
host: 'mc.chomens41793.ga',
|
||||
port: 25565,
|
||||
kaboom: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -7,6 +7,7 @@ function inject(bot, dcclient, config) {
|
|||
let gameMode = 1;
|
||||
let prefix = false;
|
||||
let muted = false;
|
||||
let endCredits = false;
|
||||
|
||||
bot.on('parsed_chat', (data) => {
|
||||
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) => {
|
||||
if (data.reason === 4) endCredits = true;
|
||||
|
||||
if (data.reason !== 3) return;
|
||||
|
||||
gameMode = data.gameMode;
|
||||
|
@ -64,6 +67,7 @@ function inject(bot, dcclient, config) {
|
|||
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 (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);
|
||||
|
||||
bot.once('end', () => {
|
||||
|
|
Loading…
Reference in a new issue