Simplify library usage even more

This commit is contained in:
Wizou 2021-10-15 04:24:34 +02:00
parent 98a95376f3
commit c5c8b49331
2 changed files with 3 additions and 1 deletions

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TL;

View file

@ -111,6 +111,7 @@ namespace WTelegram
private static string AskConfig(string config)
{
if (config == "api_id") Console.WriteLine("You can obtain your api_id/api_hash at https://my.telegram.org/apps");
Console.Write($"Enter {config.Replace('_', ' ')}: ");
return Console.ReadLine();
}
@ -885,6 +886,7 @@ namespace WTelegram
/// <returns>Detail about the logged bot</returns>
public async Task<User> LoginBotIfNeeded()
{
await ConnectAsync();
string botToken = Config("bot_token");
if (_session.User != null)
{
@ -919,6 +921,7 @@ namespace WTelegram
/// <returns>Detail about the logged user</returns>
public async Task<User> LoginUserIfNeeded(CodeSettings settings = null)
{
await ConnectAsync();
string phone_number = null;
if (_session.User != null)
{