Use the new version of TelegramBotFramework

This commit is contained in:
2021-12-22 01:27:56 +04:00
parent 2c158330cc
commit 73ed1d88a9
7 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AleXr64.BotFramework" Version="0.0.17" />
<PackageReference Include="AleXr64.BotFramework" Version="0.3.11" />
<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" />
+1 -1
View File
@@ -20,6 +20,6 @@ namespace Kruzya.TelegramBot.Core.Data
/// <summary>
/// The Telegram User identifier.
/// </summary>
public int UserId { get; set; }
public long UserId { get; set; }
}
}
+4 -4
View File
@@ -51,7 +51,7 @@ namespace Kruzya.TelegramBot.Core.Extensions
#region BotUser
public static async Task<BotUser> FindOrCreate(this DbSet<BotUser> repository, long chatId, int userId)
public static async Task<BotUser> FindOrCreate(this DbSet<BotUser> repository, long chatId, long userId)
{
var user = await repository.SingleOrDefaultAsync(e => e.ChatId == chatId && e.UserId == userId);
if (user == null)
@@ -76,7 +76,7 @@ namespace Kruzya.TelegramBot.Core.Extensions
public static async Task<BotUserValue> FindOption(this DbSet<BotUserValue> repository, BotUser user,
string option) => await repository.FindOption(user.ChatId, user.UserId, option);
public static async Task<BotUserValue> FindOption(this DbSet<BotUserValue> repository, long chatId, int userId,
public static async Task<BotUserValue> FindOption(this DbSet<BotUserValue> repository, long chatId, long userId,
string option) => await repository.SingleOrDefaultAsync(e =>
e.BotUser.ChatId == chatId && e.BotUser.UserId == userId && e.Name == option);
@@ -91,7 +91,7 @@ namespace Kruzya.TelegramBot.Core.Extensions
string option) => await repository.FindOrCreateOption(user.ChatId, user.UserId, option);
public static async Task<BotUserValue> FindOrCreateOption(this DbSet<BotUserValue> repository, long chatId,
int userId, string option)
long userId, string option)
{
var opt = await repository.FindOption(chatId, userId, option);
if (opt == null)
@@ -113,7 +113,7 @@ namespace Kruzya.TelegramBot.Core.Extensions
public static async Task SetOptionValue<T>(this DbSet<BotUserValue> repository, BotUser user, string option,
T val) => await repository.SetOptionValue(user.ChatId, user.UserId, option, val);
public static async Task SetOptionValue<T>(this DbSet<BotUserValue> repository, long chatId, int userId,
public static async Task SetOptionValue<T>(this DbSet<BotUserValue> repository, long chatId, long userId,
string option, T val)
{
var opt = await repository.FindOrCreateOption(chatId, userId, option);
+2 -2
View File
@@ -53,7 +53,7 @@ namespace Kruzya.TelegramBot.Core
await VerifyChatPair(chat.Id, user.Id);
}
public async Task VerifyChatPair(long chat, int user)
public async Task VerifyChatPair(long chat, long user)
{
var hasEntry = await databaseContext.Users.AnyAsync(e => e.ChatId == chat && e.UserId == user);
if (hasEntry)
@@ -64,7 +64,7 @@ namespace Kruzya.TelegramBot.Core
await MakeChatPair(chat, user);
}
public async Task MakeChatPair(long chat, int user)
public async Task MakeChatPair(long chat, long user)
{
await databaseContext.Users.AddAsync(new BotUser()
{