1
0
Fork 0
mirror of https://gitlab.com/niansa/discordlistforbots.git synced 2025-03-06 20:49:22 +01:00

Added bot link to registeration webhook message

This commit is contained in:
niansa 2021-03-24 10:52:41 +01:00
parent b55683c4e5
commit 4154f2ae0f

View file

@ -399,10 +399,11 @@ void views::botregister_submit(const HttpRequestPtr& req, std::function<void (co
db->execSqlAsync(fmt::format("INSERT INTO bots (name, short_description, long_description, avatar_url, owner, support_server, prefix, owner_id, app_id, votes, approved) "
"VALUES('{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', 0, 'f')",
dbEsc(botuser["username"].asString()), dbEsc(short_description), dbEsc(long_description), dbEsc(botuser["avatar_url"].asString()), sessionData->discord_fullname(), dbEsc(support_server), dbEsc(prefix), sessionData->discord_id, app_id),
[app_id, sessionData, callback] (const orm::Result &) {
[req, app_id, sessionData, callback] (const orm::Result &) {
callback(HttpResponse::newRedirectionResponse(std::to_string(app_id)+"/detail"));
// Send webhook log message
webhookSend("Bot `"+std::to_string(app_id)+"` registered by `"+std::to_string(sessionData->discord_id)+'`');
webhookSend("Bot `"+std::to_string(app_id)+"` registered by `"+std::to_string(sessionData->discord_id)+"`\n"
"Link: http://"+req->getHeader("Host")+"/bots/"+std::to_string(app_id)+"/detail");
}, dbErr);
});
}, dbErr);