la concha puta de tu abuela
This commit is contained in:
parent
caf3b744e2
commit
48118c40b9
23
index.js
23
index.js
@ -108,15 +108,12 @@ client.addListener('registered', () => {
|
|||||||
const args = split[1].split(' ')[1] ? split[1].split(' ')[1] : ""
|
const args = split[1].split(' ')[1] ? split[1].split(' ')[1] : ""
|
||||||
switch (terminalCommand) {
|
switch (terminalCommand) {
|
||||||
case "switch_channel":
|
case "switch_channel":
|
||||||
console.log("Received args:", args);
|
|
||||||
if (!args) {
|
if (!args) {
|
||||||
console.log("Arguments required");
|
console.log("Arguments required");
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if (!settings.client.chans.includes(args)) {
|
console.log(client.chans)
|
||||||
console.log(`You're not in that channel!`);
|
if(!checkIfIsInChannelAndLog(args)) break
|
||||||
break
|
|
||||||
}
|
|
||||||
currentChannel = args;
|
currentChannel = args;
|
||||||
console.log("Current Channel set to:", currentChannel);
|
console.log("Current Channel set to:", currentChannel);
|
||||||
break;
|
break;
|
||||||
@ -126,13 +123,9 @@ client.addListener('registered', () => {
|
|||||||
case "get_users":
|
case "get_users":
|
||||||
let channel = currentChannel
|
let channel = currentChannel
|
||||||
if(args){
|
if(args){
|
||||||
if (!settings.channels.includes(args)){
|
if(!checkIfIsInChannelAndLog(channel)) break
|
||||||
console.log("You're not in that channel!")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
channel = args
|
channel = args
|
||||||
}
|
}
|
||||||
console.log(client.chans[channel])
|
|
||||||
for (user in client.chans[channel].users){
|
for (user in client.chans[channel].users){
|
||||||
console.log(user)
|
console.log(user)
|
||||||
}
|
}
|
||||||
@ -147,4 +140,12 @@ client.addListener('registered', () => {
|
|||||||
|
|
||||||
rl.prompt();
|
rl.prompt();
|
||||||
messagePrompt()
|
messagePrompt()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function checkIfIsInChannelAndLog(channel){
|
||||||
|
if(!client.chans[channel]){
|
||||||
|
console.log(`You're not in that channel!`);
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user