mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Accept bot username in chatbot setup.
This commit is contained in:
parent
7092fe2242
commit
e6af33367e
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue