Загрузить файлы в «/»

This commit is contained in:
8nlight 2023-10-09 17:16:02 +03:00
parent 32b577d342
commit 79a504e10b
3 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,7 @@
CFLAGS?= -s -Os -flto -pedantic
CC?=cc
all:
cc *.c $(CFLAGS) -obot
$(CC) *.c $(CFLAGS) -obot
clean:
rm irc.* bot

6
cfg.h
View File

@ -4,7 +4,11 @@
#define PORT 6667
#define DIR "./"
char *channels[] = {"#channel"};
char *channels[] = {"#channel", NULL};
//Put \r\n after string end
//Exp: {..., "PRIVMSG NickServ IDENTIFY mypassword\r\n", ..., NULL};
char *send_after_join[] = {NULL};
//Output
#define FORMAT_TXT "<%s> %s\n"

7
main.c
View File

@ -88,6 +88,13 @@ int main(void) {
free(tmp);
}
for (size_t i = 0; i < sizeof(send_after_join) / sizeof(char *); i++) {
if (send_after_join[i] == NULL)
break;
send(client.socket, send_after_join[i], strlen(send_after_join[i]), 0);
}
recvinfo();
}