mirror of
https://github.com/Syping/dtranslatebot.git
synced 2025-09-11 11:16:38 +02:00
add /list languages command, minor fixes
This commit is contained in:
parent
7dcb64f7cf
commit
ea2c6c460f
5 changed files with 55 additions and 15 deletions
|
@ -203,7 +203,8 @@ void process_url(const std::string &url, translator *translator)
|
|||
translator->url = "/";
|
||||
url_v = url_v.substr(0, slash_pos);
|
||||
}
|
||||
auto colon_pos = url_v.find_first_of(':');
|
||||
// We don't have IPv6 support here yet
|
||||
auto colon_pos = url_v.find_last_of(':');
|
||||
if (colon_pos != std::string_view::npos) {
|
||||
translator->hostname = url_v.substr(0, colon_pos);
|
||||
const int port = std::stoi(std::string(url_v.substr(colon_pos + 1)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue