mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
precision on tg://user?id=
This commit is contained in:
parent
e615f83db6
commit
8d8465fa64
2
.github/ci.yml → .github/dev.yml
vendored
2
.github/ci.yml → .github/dev.yml
vendored
|
|
@ -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
2
.github/release.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
pr: none
|
||||
trigger: none
|
||||
|
||||
name: 1.5.$(Rev:r)
|
||||
name: 1.6.$(Rev:r)
|
||||
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue