mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Update to new Telegram.Bot.
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AleXr64.BotFramework" Version="0.5.21" />
|
||||
<PackageReference Include="AleXr64.BotFramework" Version="0.6.3-gea779222d8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.2" />
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace Kruzya.TelegramBot.Core
|
||||
[HandleEverything]
|
||||
public async Task Listener()
|
||||
{
|
||||
Console.WriteLine("handle");
|
||||
foreach (var message in new Message[] {RawUpdate.Message, RawUpdate.EditedMessage, RawUpdate.ChannelPost, RawUpdate.EditedChannelPost})
|
||||
{
|
||||
if (message == null)
|
||||
@@ -37,7 +38,7 @@ namespace Kruzya.TelegramBot.Core
|
||||
continue;
|
||||
}
|
||||
|
||||
await VerifyChatPair(message);
|
||||
return new Task();
|
||||
}
|
||||
|
||||
throw new ArgumentException();
|
||||
|
||||
@@ -3,8 +3,10 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BotFramework;
|
||||
using BotFramework.Abstractions;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Exceptions;
|
||||
using Telegram.Bot.Types;
|
||||
|
||||
@@ -15,11 +17,11 @@ namespace Kruzya.TelegramBot.Core.Service
|
||||
private Timer _timer;
|
||||
|
||||
protected readonly ILogger _logger;
|
||||
protected readonly ITelegramBot _bot;
|
||||
protected readonly IBotInstance _bot;
|
||||
|
||||
protected virtual TimeSpan TimerPeriod => TimeSpan.FromSeconds(45);
|
||||
|
||||
protected AbstractTimedHostedService(ILogger logger, ITelegramBot bot)
|
||||
protected AbstractTimedHostedService(ILogger logger, IBotInstance bot)
|
||||
{
|
||||
_bot = bot;
|
||||
_logger = logger;
|
||||
|
||||
@@ -7,7 +7,17 @@
|
||||
}
|
||||
},
|
||||
|
||||
"BotConfig": {
|
||||
"token": "5093569980:AAEnrlpg2VYD0CyQYIZtWpUuRrlpkDG8NaI"
|
||||
},
|
||||
|
||||
"ModuleDirectories": [
|
||||
"C:\\Users\\Andriy\\RiderProjects\\telegram-bot\\modules\\Destiny2.WhereIsXur\\bin\\Debug\\net5.0",
|
||||
"C:\\Users\\Andriy\\RiderProjects\\telegram-bot\\modules\\RichSiteSummary\\bin\\Debug\\net5.0"
|
||||
],
|
||||
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "server=127.0.0.1;UserId=rider;Password=rider;database=rider;port=8889"
|
||||
"DefaultConnection": "server=127.0.0.1;UserId=root;Password=;database=kruzyatgbot-core;port=3306",
|
||||
"RichSiteSummary": "server=127.0.0.1;UserId=root;Password=;database=kruzyatgbot-rss;port=3306"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user