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] : ""
|
||||
switch (terminalCommand) {
|
||||
case "switch_channel":
|
||||
console.log("Received args:", args);
|
||||
if (!args) {
|
||||
console.log("Arguments required");
|
||||
break
|
||||
}
|
||||
if (!settings.client.chans.includes(args)) {
|
||||
console.log(`You're not in that channel!`);
|
||||
break
|
||||
}
|
||||
console.log(client.chans)
|
||||
if(!checkIfIsInChannelAndLog(args)) break
|
||||
currentChannel = args;
|
||||
console.log("Current Channel set to:", currentChannel);
|
||||
break;
|
||||
@ -126,13 +123,9 @@ client.addListener('registered', () => {
|
||||
case "get_users":
|
||||
let channel = currentChannel
|
||||
if(args){
|
||||
if (!settings.channels.includes(args)){
|
||||
console.log("You're not in that channel!")
|
||||
break
|
||||
}
|
||||
if(!checkIfIsInChannelAndLog(channel)) break
|
||||
channel = args
|
||||
}
|
||||
console.log(client.chans[channel])
|
||||
for (user in client.chans[channel].users){
|
||||
console.log(user)
|
||||
}
|
||||
@ -147,4 +140,12 @@ client.addListener('registered', () => {
|
||||
|
||||
rl.prompt();
|
||||
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