removed idea from commands

This commit is contained in:
William Mantly 2023-05-10 10:18:15 -04:00
parent 251b250f00
commit 77343d0735
2 changed files with 14 additions and 22 deletions

View File

@ -83,14 +83,14 @@ module.exports = {
await this.say(`> ${res.data.slip.advice}`); await this.say(`> ${res.data.slip.advice}`);
} }
}, },
'idea': { // 'idea': {
desc: `Say a random start up idea.`, // desc: `Say a random start up idea.`,
async function(from){ // async function(from){
await this.say('> How about?'); // await this.say('> How about?');
let res = await axios.get('https://itsthisforthis.com/api.php?text') // let res = await axios.get('https://itsthisforthis.com/api.php?text')
await this.say(`> ${res.data}`); // await this.say(`> ${res.data}`);
} // }
}, // },
'discord': { 'discord': {
desc: `Say the CJ discord invite link.`, desc: `Say the CJ discord invite link.`,
async function(from) { async function(from) {
@ -100,6 +100,8 @@ module.exports = {
'dice': { 'dice': {
desc: `Roll a die. You can state the max size on the dice. Default is 6.`, desc: `Roll a die. You can state the max size on the dice. Default is 6.`,
async function(from, size){ async function(from, size){
console.log('dice', size)
size = size || 6; size = size || 6;
if(!Number.isInteger(Number(size))){ if(!Number.isInteger(Number(size))){
this.whisper(from, `${size} is not a whole number...`) this.whisper(from, `${size} is not a whole number...`)
@ -123,9 +125,9 @@ module.exports = {
'random-player': { 'random-player': {
desc: `Return a random online player.`, desc: `Return a random online player.`,
async function(from){ async function(from){
let players = bot.getPlayers() let players = this.getPlayers()
delete players[bot.bot.entity.username] delete players[this.bot.entity.username]
let keys = Object.keys(players); let keys = Object.keys(players);
let player = players[keys[ keys.length * Math.random() << 0]]; let player = players[keys[ keys.length * Math.random() << 0]];

View File

@ -34,19 +34,7 @@ class CJbot{
connect(){ connect(){
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) =>{
// let cancle = setTimeout(()=>{
// reject('TimeOut')
// }, 10000)
// resolve = (...args)=>{
// clearTimeout(cancle);
// return resolve(...args);
// }
// reject = (...args)=>{
// // clearTimeout(cancle);
// return reject(...args);
// }
this.bot = mineflayer.createBot({ this.bot = mineflayer.createBot({
host: this.host, host: this.host,
username: this.username, username: this.username,
@ -189,6 +177,8 @@ class CJbot{
// teleport invite // teleport invite
// console.log('ChatBot on message', message.toString()) // console.log('ChatBot on message', message.toString())
console.log('found teleport', message.toString().split(' ')[0])
this.__doCommand(message.toString().split(' ')[0], '.invite'); this.__doCommand(message.toString().split(' ')[0], '.invite');
} }