Closed oxagast closed 6 months ago
Some points that should be included in the per user summary database:
This should be called when a user asks a question of Franklin that includes this user's nickname in chat, and it will be rolled into the DCP, independently of the question asked, for more complete context. Essentially this creates a minimal profile of each user so the bot can call on real information, instead of simply guessing.
The file format may look similar to the below for each chatter that has chatted in the channel Franklin is in.
[format version ]{4 }
[franklin ver that wrote it ]{8 }
[nick (max 9 chars) ]{9 }
[null padding ]{8 }
[user summary init date (date) ]{4 }
[last message date(date) ]{4 }
[num msgs since dbase init (unsigned int) ]{4 }
[num times queried franklin (unsigned int) ]{4 }
[total times this user is mentioned by other chatters(unsigned int) }{4 }
[avg messages to all chats per hour(unsigned int) ]{4 }
[avg line len (short int) ]{2 }
[operator status from user/voice/hop/op (byte) ]{1 }
[3 512 byte messages user sent as a char arr null padded(str) ]{1536}
[null (null padding) ]{8 }
[3 random 512 byte messages sent to chat since init null padded (str) ]{1536}
[null padding ]{8 }
[checksum ]{4 }
Or...
{
"versions": {
"userfile": "1.0.0",
"franklin": "4.0.0"
},
"nick": "oxagast",
"create_date": "04182024",
"last_messsage_date": "04192024",
"total_messages": 55,
"queried_bot": 12,
"other_mentions": 3,
"messages_per_hour": 2,
"average_message_length": 77,
"operator": true,
"messages": {
"last_messages": [
"hello how are you",
"oh yeah im fine",
"yeah my name is oxagast, whats yours"
],
"random_messages": [
"blah",
"no i like girls toes",
"Franklin: tell me about nyc"
]
},
"checksum": "B2CCA97A"
}
Implementation ends up looking similar to:
%summdb = ((versions => { selfver => $userfile, frankver => $franklinver }),
($nick => {create_date => "$create_date", change_date => "$change_date",
total_messages => $totmsgs, queries_per_day => 0, mentions_per_day => 0,
messages_per_day => 0, average_message_length => 0, operator => false,
(messages => {last => [ $lastm[0], $lastm[1], $lastm[2] ],
random => [ $rndm[0], $rndm[1], $rndm[2] ]})}));
$json_nick = create_json (\%summdb);
Thus the .json in the database, written by franklin_profiler.pl, ends up being something similar to:
{
"oxagast": {
"total_messages": "222",
"messages": {
"last": [
"sorry for all the pings man",
"my ad",
"jeez 50 percent?",
"thats insane",
"fuck",
"Franklin: how long is aestetix's average text on irc",
"Franklin: how many queries have i made to you today Franklin ",
"not yet"
],
"random": []
},
"operator": "false",
"queries_per_day": "66",
"change_date": "05-14-2024",
"messages_per_day": "221",
"average_message_length": "26.3021819591497",
"create_date": "05132024"
},
"versions": {
"selfver": "1.2.0",
"frankver": "4.5.0"
}
}
This is then parsed in franklin.pl, and stuck on the end of the DCP for both the user calling Franklin, as well as any users that they mention in the query.
Currently the things recorded and updated in the user dbase are:
The result?
Notes: