mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Accept bot username in chatbot setup.
This commit is contained in:
@@ -226,6 +226,9 @@ Main::Session &PreviewController::session() const {
|
||||
|
||||
[[nodiscard]] QString ExtractUsername(QString text) {
|
||||
text = text.trimmed();
|
||||
if (text.startsWith(QChar('@'))) {
|
||||
return text.mid(1);
|
||||
}
|
||||
static const auto expression = QRegularExpression(
|
||||
"^(https://)?([a-zA-Z0-9\\.]+/)?([a-zA-Z0-9_\\.]+)");
|
||||
const auto match = expression.match(text);
|
||||
|
||||
Reference in New Issue
Block a user