From 3942b17c64da6651f2b495566ffaba84fbd2dba0 Mon Sep 17 00:00:00 2001 From: Nikolay Kochulin Date: Sun, 17 Nov 2019 13:41:25 +0000 Subject: [PATCH] Switch awardtypeid to int + fix /at help --- JetKarmaBot/Commands/AwardCommand.cs | 2 +- JetKarmaBot/Commands/AwardTypeCommand.cs | 2 +- JetKarmaBot/Commands/LeaderboardCommand.cs | 2 +- JetKarmaBot/Commands/StatusCommand.cs | 2 +- JetKarmaBot/Models/Award.cs | 2 +- JetKarmaBot/Models/AwardType.cs | 2 +- JetKarmaBot/Models/KarmaContext.cs | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/JetKarmaBot/Commands/AwardCommand.cs b/JetKarmaBot/Commands/AwardCommand.cs index 260f8b2..b326646 100644 --- a/JetKarmaBot/Commands/AwardCommand.cs +++ b/JetKarmaBot/Commands/AwardCommand.cs @@ -91,7 +91,7 @@ namespace JetKarmaBot.Commands var text = args.Message.Text; string awardTypeAcc, awardTypeSym; - sbyte? awardTypeId; + int? awardTypeId; if (awardTypeText == null || awardTypeText == "star") { awardTypeAcc = currentLocale["jetkarmabot.star.accusative"]; diff --git a/JetKarmaBot/Commands/AwardTypeCommand.cs b/JetKarmaBot/Commands/AwardTypeCommand.cs index d40a6ba..c68fa64 100644 --- a/JetKarmaBot/Commands/AwardTypeCommand.cs +++ b/JetKarmaBot/Commands/AwardTypeCommand.cs @@ -30,7 +30,7 @@ namespace JetKarmaBot.Commands VerbRouter.Add(C.GetInstance()); VerbRouter.Add(C.GetInstance()); VerbRouter.Add(C.GetInstance()); - VerbRouter.Add(C.GetInstance()); + VerbRouter.Add(C.ResolveObject(new HelpCommand())); } public IReadOnlyCollection Arguments => new[] { diff --git a/JetKarmaBot/Commands/LeaderboardCommand.cs b/JetKarmaBot/Commands/LeaderboardCommand.cs index 26cc031..eef5729 100644 --- a/JetKarmaBot/Commands/LeaderboardCommand.cs +++ b/JetKarmaBot/Commands/LeaderboardCommand.cs @@ -28,7 +28,7 @@ namespace JetKarmaBot.Commands string response; string awardTypeSym; - sbyte? awardTypeId; + int? awardTypeId; if (string.IsNullOrWhiteSpace(awardTypeName) || awardTypeName == "star") { awardTypeId = null; diff --git a/JetKarmaBot/Commands/StatusCommand.cs b/JetKarmaBot/Commands/StatusCommand.cs index 56db65e..468c3b4 100644 --- a/JetKarmaBot/Commands/StatusCommand.cs +++ b/JetKarmaBot/Commands/StatusCommand.cs @@ -54,7 +54,7 @@ namespace JetKarmaBot.Commands } else { - sbyte? awardTypeId; + int? awardTypeId; string awardTypeSym; if (awardTypeName == "star") { diff --git a/JetKarmaBot/Models/Award.cs b/JetKarmaBot/Models/Award.cs index 36354f4..e0e369b 100644 --- a/JetKarmaBot/Models/Award.cs +++ b/JetKarmaBot/Models/Award.cs @@ -10,7 +10,7 @@ namespace JetKarmaBot.Models public long ChatId { get; set; } public int FromId { get; set; } public int ToId { get; set; } - public sbyte? AwardTypeId { get; set; } + public int? AwardTypeId { get; set; } public sbyte Amount { get; set; } public DateTime Date { get; set; } [ForeignKey("AwardTypeId")] diff --git a/JetKarmaBot/Models/AwardType.cs b/JetKarmaBot/Models/AwardType.cs index 3b67531..e18f5b6 100644 --- a/JetKarmaBot/Models/AwardType.cs +++ b/JetKarmaBot/Models/AwardType.cs @@ -11,7 +11,7 @@ namespace JetKarmaBot.Models Awards = new HashSet(); } - public sbyte AwardTypeId { get; set; } + public int AwardTypeId { get; set; } public string CommandName { get; set; } public long ChatId { get; set; } public string NominativeName { get; set; } diff --git a/JetKarmaBot/Models/KarmaContext.cs b/JetKarmaBot/Models/KarmaContext.cs index c85c2db..3a3d22c 100644 --- a/JetKarmaBot/Models/KarmaContext.cs +++ b/JetKarmaBot/Models/KarmaContext.cs @@ -60,7 +60,7 @@ namespace JetKarmaBot.Models entity.Property(e => e.AwardTypeId) .HasColumnName("awardtypeid") - .HasColumnType("tinyint(3)"); + .HasColumnType("int(11)"); entity.Property(e => e.ChatId) .HasColumnName("chatid") @@ -118,7 +118,7 @@ namespace JetKarmaBot.Models entity.Property(e => e.AwardTypeId) .HasColumnName("awardtypeid") - .HasColumnType("tinyint(3)"); + .HasColumnType("int(11)"); entity.Property(e => e.CommandName) .IsRequired()