changed config to DokuWiki base url

main
Michael Mandl 2018-03-31 13:37:51 +02:00
parent b3fb42db81
commit e618966f29
2 changed files with 7 additions and 3 deletions

View File

@ -11,7 +11,8 @@ int main(int argc, char **argv)
{ {
Settings settings(argc, argv); Settings settings(argc, argv);
DokuWiki wiki(settings.wikiUrl, settings.wikiUser, settings.wikiPassword); DokuWiki wiki(settings.wikiUrl + "/lib/exe/xmlrpc.php",
settings.wikiUser, settings.wikiPassword);
tgbot::LongPollBot bot(settings.telegramToken); tgbot::LongPollBot bot(settings.telegramToken);
bot.callback([&wiki, &settings](const tgbot::types::Message message, bot.callback([&wiki, &settings](const tgbot::types::Message message,
@ -46,7 +47,10 @@ int main(int argc, char **argv)
api.sendMessage(std::to_string(message.chat.id), reply.str()); api.sendMessage(std::to_string(message.chat.id), reply.str());
} }
api.sendMessage(std::to_string(message.chat.id), "Stored to wiki"); std::ostringstream pageUrl;
pageUrl << settings.wikiUrl << "/doku.php?id=" << "beezletest";
api.sendMessage(std::to_string(message.chat.id),
"Stored to wiki at " + pageUrl.str());
} }
} }
}); });

View File

@ -3,7 +3,7 @@ token = 123456789:ABCDEFG1234567HIJKLMN8901234abcdefg
users = my_telegram_user users = my_telegram_user
[DokuWiki] [DokuWiki]
url = https://my.webserver.url/dokuwiki/lib/exe/xmlrpc.php url = https://my.webserver.url/dokuwiki
username = wiki_username username = wiki_username
password = wiki_password password = wiki_password