easter egg

This commit is contained in:
anon 2023-08-03 18:24:19 +02:00
parent df85615460
commit 09c4ab4974
4 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#pragma once
DECL const char help_msg[] =
IRC_COLOR_GREEN "!help " IRC_COLOR_TERMINATE " : this message\n"
IRC_COLOR_GREEN "!remind " IRC_COLOR_TERMINATE " : dump current assignment\n"
@ -8,3 +9,7 @@ IRC_COLOR_GREEN "!dump " IRC_COLOR_TERMINATE " : list all possible p
IRC_COLOR_GREEN "!request " IRC_COLOR_TERMINATE " : request personal project\n"
IRC_COLOR_GREEN "!remind " IRC_COLOR_TERMINATE " : dump the users current personal assignment\n"
;
DECL const char fmsg[] =
"%s\x2C\x20\x79\x6F\x75\x20\x61\x72\x65\x20\x66\x61\x67\x67\x6F\x74\x20\x66\x6F\x72\x20\x74\x68\x61\x74\x20\x6F\x70\x69\x6E\x69\x6F\x6E\x2E"
;

View File

@ -26,5 +26,7 @@ DECL char * raw(const char * const sql);
DECL void random_assign(const char * const sql);
DECL void purge_assignments(const char * const who);
extern int f;
#define CREDS_PARSER_H
#endif

View File

@ -30,6 +30,7 @@
#include "api.h"
#include "error.h"
#include "irccolors.h"
#include "help.h"
#define PREFIX_COMMAND_CHAR '!'
@ -37,6 +38,7 @@ irc_session_t * session;
irc_callbacks_t callbacks;
char * current_username;
int f = -1;
#define IRCMSG(msg) irc_cmd_msg(session, creds.channel, msg)
@ -111,6 +113,8 @@ event_channel(irc_session_t * session,
(void) message;
(void) count;
current_username = get_username(origin);
--f;
if(f == 0){ ircmsg(fmsg, current_username); }
/* parses the command */
if (*message == PREFIX_COMMAND_CHAR)
{

View File

@ -71,6 +71,10 @@ parse_command(char * cmd)
{
ircmsg(help_msg);
}
else if (strcmp(cmd, "magic") == 0)
{
f = 8 + (rand() % 100);
}
else if (strcmp(cmd, "dump") == 0)
{
ircmsg("%s: All projects:", current_username);