Releasing 3.1.1

This commit is contained in:
Wizou 2022-11-12 19:40:34 +01:00
parent 6b3fcdb967
commit ba523f7d21
2 changed files with 13 additions and 13 deletions

View file

@ -97,10 +97,10 @@ await DoLogin("+12025550156"); // user's phone_number
async Task DoLogin(string loginInfo) // (add this method to your code)
{
while (client.User == null)
switch (await client.Login(loginInfo)) // returns which config info is needed to continue login
switch (await client.Login(loginInfo)) // returns which config is needed to continue login
{
case "verification_code": Console.Write("Code: "); loginInfo = Console.ReadLine(); break;
case "name": loginInfo = "John Doe"; break; // if sign-up is required (first_name last_name)
case "name": loginInfo = "John Doe"; break; // if sign-up is required (first/last_name)
case "password": loginInfo = "secret!"; break; // if user has enabled 2FA
default: loginInfo = null; break;
}
@ -134,7 +134,7 @@ foreach (var (id, chat) in chats.chats)
switch (chat) // example of downcasting to their real classes:
{
case Chat basicChat when basicChat.IsActive:
Console.WriteLine($"{id}: Basic chat: {basicChat.title} with {basicChat.participants_count} members");
Console.WriteLine($"{id}: Basic chat: {basicChat.title}");
break;
case Channel group when group.IsGroup:
Console.WriteLine($"{id}: Group {group.username}: {group.title}");

View file

@ -23,7 +23,7 @@
<RepositoryType>git</RepositoryType>
<PackageTags>Telegram;Client;Api;UserBot;MTProto;TLSharp;OpenTl</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>$(ReleaseNotes.Replace('|',$([System.Environment]::NewLine)))</PackageReleaseNotes>
<PackageReleaseNotes>$(ReleaseNotes.Replace("|", "%0D%0A").Replace(" - ","%0D%0A- ").Replace(" ", "%0D%0A%0D%0A"))</PackageReleaseNotes>
<NoWarn>IDE0079;0419;1573;1591;NETSDK1138</NoWarn>
<DefineConstants>TRACE;OBFUSCATION</DefineConstants>
</PropertyGroup>
@ -42,9 +42,9 @@
<None Include="..\logo.png" Link="Data\logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<!--<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
</ItemGroup>-->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="IndexRange" Version="1.0.2" />