shit nigga

This commit is contained in:
simio 2024-12-01 00:11:50 -03:00
parent 3ea29c9616
commit c715084a32

View File

@ -21,6 +21,8 @@ const client = new irc.Client(settings.server, settings.username, {
});
client.addListener('registered', () => {
//////////////LISTENERS////////////////////
client.addListener('error', (message) => {
console.log('Error: ' + message)
})
@ -30,8 +32,10 @@ client.addListener('registered', () => {
logMessage(from, channel, message)
});
client.addListener('join', (channel, nick) => {
logMessage(nick, channel, "Joined the channel")
//I'M THE ANIME GIRL FAGGOT
if (nick === settings.username) sendMessage(channel, "# Appears as Jhenna_Hina.http://www.mermeliz.com/hina/dl/Jhenna_Hina.AVB")
})
@ -42,36 +46,19 @@ client.addListener('registered', () => {
client.addListener('quit', (nick, reason, channels, _message) => {
for(i in channels){
logMessage(nick, channels[i], "Left.")
logMessage(nick, channels[i], "Left: " + reason)
}
})
client.addListener('kick', (channel, nick, by, reason, _message) => {
logMessage(nick, channel, "Kicked by: " + by + ": " + reason)
})
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function messagePrompt(){
rl.question(settings.username + ': ', (command) => {
// //si g!
// const split = command.split["!"][0]
// if(split === "g"){
// const terminalCommand = split[1]
// switch (terminalCommand){
// case "current_channel":
// }
// }
////////////////////////////////////////////////////////////////
sendMessage(currentChannel, command)
messagePrompt()
});
}
///LOGGING AND SHIT/////////////////////////////////////////////
function logMessage(from, channel, message){
const currentDate = new Date();
////////////////////////////////////////////////////////////////DATE FORMAT
@ -99,6 +86,50 @@ client.addListener('registered', () => {
logMessage(settings.username, channel, message)
client.say(channel, message)
}
////////////////////////////////////////////////////////////////
//COMMAND LINE SHIT/////////////////////////////////
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function messagePrompt(){
rl.question(settings.username + ': ', (command) => {
const split = command.split("!")
const prefix = split[0]
if(prefix === "g"){
const terminalCommand = split[1].split(' ')[0]
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.channels.includes(args)) {
console.log(`That channel '${args}' is not on the config!`);
break
}
currentChannel = args;
console.log("Current Channel set to:", currentChannel);
break;
case "get_current_channel":
console.log(currentChannel)
break
}
}else{
sendMessage(currentChannel, command)
}
messagePrompt()
});
}
rl.prompt();
messagePrompt()