updated prompt
This commit is contained in:
parent
3b929bfc3c
commit
177be872a8
|
@ -21,4 +21,11 @@ random_word = "0.3.0"
|
|||
leetspeak = "0.2.0"
|
||||
irc = "0.15.0"
|
||||
futures = "0.3.27"
|
||||
futures-util = "0.3.27"
|
||||
futures-util = "0.3.27"
|
||||
|
||||
lazy_static = "1.4.0"
|
||||
anyhow = "1.0.70"
|
||||
tokio-native-tls = "0.3"
|
||||
tokio-tls = "0.3.1"
|
||||
tokio-stream = "0.1.12"
|
||||
tokio-util = "0.7.0"
|
|
@ -1,8 +1,8 @@
|
|||
nick = "g1r"
|
||||
server = "ircd.chat"
|
||||
port = 6697
|
||||
password = ""
|
||||
channels = [ "#s4d", "#emo", "#tcpdirect", "#macros", "#b0tsh0p" ] #add key access
|
||||
password = "mine"
|
||||
channels = [ "#s4d", "wiki", "#emo", "#tcpdirect", "#macros", "#b0tsh0p" ] #add key access
|
||||
admin_users = ["s4d", "sad", "g", "d", "h3x", "kayos", "moony"] # add host identification
|
||||
ignore_users = ["maple", "aibird", "professorOak", "van"]
|
||||
openai = "sk-"
|
||||
|
@ -10,6 +10,9 @@ model = "gpt-3.5-turbo"
|
|||
accents = "funny, completely insane, and hyperactive"
|
||||
personalities = "GIR from Invader Zim"
|
||||
|
||||
# SMTP
|
||||
|
||||
# TOR
|
||||
proxy_server = "127.0.0.1"
|
||||
proxy_port = 9050
|
||||
|
||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -40,7 +40,7 @@ struct Config {
|
|||
|
||||
}
|
||||
fn main() {
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
let _rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap();
|
||||
|
@ -117,11 +117,7 @@ fn main() {
|
|||
for response in invade_command.handle(message) {
|
||||
ssl_stream.write_all(response.as_bytes()).unwrap();
|
||||
}
|
||||
} else if message.contains(":%code") {
|
||||
for response in aicode.handle(message) {
|
||||
ssl_stream.write_all(response.as_bytes()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the message is user and respond via ai
|
||||
|
@ -141,7 +137,13 @@ fn main() {
|
|||
ssl_stream.write_all(response.as_bytes()).unwrap();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if message.contains(":%code") {
|
||||
for response in aicode.handle(message) {
|
||||
ssl_stream.write_all(response.as_bytes()).unwrap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
Err(e) => {
|
||||
|
|
|
@ -53,7 +53,7 @@ async fn ai(user_message: &str, username: &str, channel: &str, config: &Config)
|
|||
.messages([
|
||||
ChatCompletionRequestMessageArgs::default()
|
||||
.role(Role::System)
|
||||
.content(format!("Respond {} as you are chatting as {}, {} sent you a message, dont respond for them:", config.accents, config.personalities, username))
|
||||
.content(format!("Respond {} as you are chatting as {}, {} sent the following, respond as you should:", config.accents, config.personalities, username))
|
||||
.build()
|
||||
.unwrap(),
|
||||
ChatCompletionRequestMessageArgs::default()
|
||||
|
|
|
@ -11,6 +11,8 @@ use regex::Regex;
|
|||
|
||||
//use anyhow::Result;
|
||||
//use socks5_proxy::{client, Addr};
|
||||
// use tokio::net::TcpStream;
|
||||
use tokio_native_tls::{TlsConnector, TlsStream};
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
// add better error handling
|
||||
|
@ -26,6 +28,7 @@ struct Config {
|
|||
|
||||
pub struct InvadeCommand;
|
||||
|
||||
|
||||
impl Command for InvadeCommand {
|
||||
fn handle(&self, message: &str) -> Vec<String> {
|
||||
let mut response = vec![];
|
||||
|
|
Loading…
Reference in New Issue