diff --git a/README.md b/README.md
@@ -29,6 +29,7 @@ This is being developed in my free time as a fun project. It is no where near be
- [X] Wifi scanning & selection menu
- [ ] Saved wifi profiles
- [X] IRC Client
+- [X] `/raw` command for IRC client to send raw data to the server
- [ ] ChatGPT
- [ ] SSH Client
- [ ] Wardriving
diff --git a/src/main.ino b/src/main.ino
@@ -236,8 +236,13 @@ void parseAndDisplay(String line) {
void handleKeyboardInput(char key) {
if (key == '\n' || key == '\r') { // Enter
- sendIRC("PRIVMSG " + String(channel) + " :" + inputBuffer);
- addLine(nick, inputBuffer, "message");
+ if (inputBuffer.startsWith("/raw ")) {
+ String rawCommand = inputBuffer.substring(5); // Remove "/raw "
+ sendRawCommand(rawCommand);
+ } else {
+ sendIRC("PRIVMSG " + String(channel) + " :" + inputBuffer);
+ addLine(nick, inputBuffer, "message");
+ }
inputBuffer = "";
displayInputLine();
} else if (key == '\b') { // Backspace
@@ -251,6 +256,15 @@ void handleKeyboardInput(char key) {
}
}
+void sendRawCommand(String command) {
+ if (client.connected()) {
+ sendIRC(command);
+ Serial.println("Sent raw command: " + command);
+ } else {
+ Serial.println("Failed to send raw command: Not connected to IRC");
+ }
+}
+
char getKeyboardInput() {
char incoming = 0;
Wire.requestFrom(LILYGO_KB_SLAVE_ADDRESS, 1);
| |