fix bug with empty author

This commit is contained in:
Syping 2024-01-17 13:18:53 +01:00
parent 2b24b90c54
commit 0e205682a3

View file

@ -56,10 +56,15 @@ int main(int argc, char* argv[]) {
if (channel) {
bot::message message;
message.id = event.msg.id;
message.author = event.msg.member.get_nickname();
if (message.author.empty())
message.author = event.msg.author.format_username();
message.avatar = event.msg.member.get_avatar_url(settings.get_avatar_size());
if (message.avatar.empty())
message.avatar = event.msg.author.get_avatar_url(settings.get_avatar_size());
message.message = event.msg.content;
message.source = channel->source;
message.targets = channel->targets;