precision on tg://user?id=

This commit is contained in:
Wizou 2021-10-31 02:56:51 +01:00
parent e615f83db6
commit 8d8465fa64
5 changed files with 5 additions and 4 deletions

View file

@ -2,7 +2,7 @@ pr: none
trigger:
- master
name: 1.5.1-ci.$(Rev:r)
name: 1.6.1-dev.$(Rev:r)
pool:
vmImage: ubuntu-latest

2
.github/release.yml vendored
View file

@ -1,7 +1,7 @@
pr: none
trigger: none
name: 1.5.$(Rev:r)
name: 1.6.$(Rev:r)
pool:
vmImage: ubuntu-latest

View file

@ -40,6 +40,7 @@ var entities = client.MarkdownToEntities(ref text);
await client.SendMessageAsync(InputPeer.Self, text, entities: entities);
```
See [MarkdownV2 formatting style](https://core.telegram.org/bots/api/#markdownv2-style) for details.
<br/>For the `tg://user?id=` notation to work, that user's access hash must have been collected first ([see below](#Collect-Access-Hash-and-save-them-for-later-use))
### List all chats (groups/channels) the user is in and send a message to one
```csharp

View file

@ -420,7 +420,7 @@ namespace TL
var url = sb.ToString(urlStart, urlLength);
sb.Remove(urlStart, urlLength + 1);
offset = urlStart;
if (url.StartsWith("tg://user?id=") && long.TryParse(url[13..], out var user_id) && client.GetAccessHashFor<User>(user_id) is long hash && hash != 0)
if (url.StartsWith("tg://user?id=") && long.TryParse(url[13..], out var user_id) && client.GetAccessHashFor<User>(user_id) is long hash)
entities[lastIndex] = new InputMessageEntityMentionName { offset = entity.offset, length = entity.length, user_id = new InputUser { user_id = user_id, access_hash = hash } };
else
((MessageEntityTextUrl)entity).url = url;

View file

@ -34,7 +34,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\.github\ci.yml" Link="Data\ci.yml" />
<None Include="..\.github\dev.yml" Link="Data\dev.yml" />
<None Include="..\logo.png" Link="Data\logo.png" Pack="true" PackagePath="\" />
<None Include="..\README.md" Link="Data\README.md" Pack="true" PackagePath="\" />
<None Include="..\.github\release.yml" Link="Data\release.yml" />