mirror of
https://github.com/Syping/dtranslatebot.git
synced 2025-12-14 23:56:26 +01:00
improvements to configuration parser
This commit is contained in:
parent
e09293cc4e
commit
a746eda39b
6 changed files with 111 additions and 61 deletions
|
|
@ -51,7 +51,7 @@ void bot::message_queue::run(dpp::cluster *bot, bot::settings::settings *setting
|
|||
dpp::json json_body = {
|
||||
{"q", message.message},
|
||||
{"source", message.source},
|
||||
{"target", target->first},
|
||||
{"target", target->target},
|
||||
{"format", "text"},
|
||||
};
|
||||
|
||||
|
|
@ -72,13 +72,13 @@ void bot::message_queue::run(dpp::cluster *bot, bot::settings::settings *setting
|
|||
}
|
||||
}
|
||||
|
||||
dpp::webhook webhook(target->second);
|
||||
dpp::webhook webhook(target->webhook);
|
||||
webhook.name = message.author;
|
||||
|
||||
try {
|
||||
bot->execute_webhook_sync(webhook, dpp::message(tr_message));
|
||||
}
|
||||
catch (dpp::rest_exception &exception) {
|
||||
catch (const dpp::rest_exception &exception) {
|
||||
std::cerr << "REST Error: " << exception.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue