mirror of
https://github.com/Syping/dtranslatebot.git
synced 2024-11-21 21:30:24 +01:00
fix bug with empty author
This commit is contained in:
parent
2b24b90c54
commit
0e205682a3
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue