refactor @username queries
This commit is contained in:
parent
0e10aa4635
commit
fe3e2551f5
|
@ -303,6 +303,9 @@ namespace telegram
|
|||
Limit = 5
|
||||
}).Result;
|
||||
|
||||
if (query.StartsWith("@"))
|
||||
return results.ChatIds.First(p =>
|
||||
GetChat(p).Type is ChatType.ChatTypePrivate type && GetUser(type.UserId).Username == query.Substring(1));
|
||||
return results.ChatIds.First();
|
||||
}
|
||||
catch
|
||||
|
@ -323,6 +326,8 @@ namespace telegram
|
|||
Limit = 5
|
||||
}).Result;
|
||||
|
||||
if (query.StartsWith("@"))
|
||||
return results.UserIds.First(p => GetUser(p).Username == query.Substring(1));
|
||||
return results.UserIds.First();
|
||||
}
|
||||
catch
|
||||
|
|
|
@ -16,8 +16,6 @@ namespace telegram
|
|||
* TODO:
|
||||
* waaay more error messages instead of just doing nothing or crashing (search for "do something")
|
||||
* add option to disable terminal bell
|
||||
* make commands & keybinds more consistent (maybe configurable?)
|
||||
* for commands with query, if query starting with @ only match where username matches *exactly*
|
||||
* command /sg -> search globally, some way to add contacts?
|
||||
* command /sc -> search in chat list & list matching chats, archived, muted indicator
|
||||
* mute,unmute chats
|
||||
|
|
Loading…
Reference in a new issue