mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-04-30 03:22:04 -04:00
Renamed the bot from KickBot -> ChatBot and removed the reference to Kick in the project name
This commit is contained in:
@@ -8,7 +8,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KfChatDotNetGui", "KfChatDo
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KickWsClient", "KickWsClient\KickWsClient.csproj", "{DECBB95C-2C9F-44C2-AFA3-3741986FBA38}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KickWsClient", "KickWsClient\KickWsClient.csproj", "{DECBB95C-2C9F-44C2-AFA3-3741986FBA38}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KfChatDotNetKickBot", "KfChatDotNetKickBot\KfChatDotNetKickBot.csproj", "{4734E0A4-150E-4915-B905-928BB4BE3FF6}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KfChatDotNetBot", "KfChatDotNetBot\KfChatDotNetBot.csproj", "{4734E0A4-150E-4915-B905-928BB4BE3FF6}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeXplWsClient", "ThreeXplWsClient\ThreeXplWsClient.csproj", "{3D72D70A-48AD-4EE8-89DC-C78153EEA879}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeXplWsClient", "ThreeXplWsClient\ThreeXplWsClient.csproj", "{3D72D70A-48AD-4EE8-89DC-C78153EEA879}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot;
|
namespace KfChatDotNetBot;
|
||||||
|
|
||||||
public class ApplicationDbContext : DbContext
|
public class ApplicationDbContext : DbContext
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using KfChatDotNetKickBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetKickBot.Services;
|
using KfChatDotNetBot.Services;
|
||||||
using KfChatDotNetKickBot.Settings;
|
using KfChatDotNetBot.Settings;
|
||||||
using KfChatDotNetWsClient;
|
using KfChatDotNetWsClient;
|
||||||
using KfChatDotNetWsClient.Models;
|
using KfChatDotNetWsClient.Models;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
@@ -10,9 +10,9 @@ using KickWsClient.Models;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot;
|
namespace KfChatDotNetBot;
|
||||||
|
|
||||||
public class KickBot
|
public class ChatBot
|
||||||
{
|
{
|
||||||
internal readonly ChatClient KfClient;
|
internal readonly ChatClient KfClient;
|
||||||
private readonly KickWsClient.KickWsClient _kickClient;
|
private readonly KickWsClient.KickWsClient _kickClient;
|
||||||
@@ -42,7 +42,7 @@ public class KickBot
|
|||||||
private Task _websocketWatchdog;
|
private Task _websocketWatchdog;
|
||||||
private Jackpot _jackpot;
|
private Jackpot _jackpot;
|
||||||
|
|
||||||
public KickBot()
|
public ChatBot()
|
||||||
{
|
{
|
||||||
_logger.Info("Bot starting!");
|
_logger.Info("Bot starting!");
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetKickBot.Settings;
|
using KfChatDotNetBot.Settings;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Commands;
|
namespace KfChatDotNetBot.Commands;
|
||||||
|
|
||||||
public class HowlggStatsCommand : ICommand
|
public class HowlggStatsCommand : ICommand
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ public class HowlggStatsCommand : ICommand
|
|||||||
public string HelpText => "Get betting statistics in the given window";
|
public string HelpText => "Get betting statistics in the given window";
|
||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var window = Convert.ToInt32(arguments["window"].Value);
|
var window = Convert.ToInt32(arguments["window"].Value);
|
||||||
var start = DateTimeOffset.UtcNow.AddHours(-window);
|
var start = DateTimeOffset.UtcNow.AddHours(-window);
|
||||||
@@ -42,7 +42,7 @@ public class HowlggRecentBetCommand : ICommand
|
|||||||
public string HelpText => "Get the most recent 3 bets";
|
public string HelpText => "Get the most recent 3 bets";
|
||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var settings = await Helpers.GetMultipleValues([
|
var settings = await Helpers.GetMultipleValues([
|
||||||
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor, BuiltIn.Keys.HowlggDivisionAmount
|
BuiltIn.Keys.KiwiFarmsGreenColor, BuiltIn.Keys.KiwiFarmsRedColor, BuiltIn.Keys.HowlggDivisionAmount
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Commands;
|
namespace KfChatDotNetBot.Commands;
|
||||||
|
|
||||||
internal interface ICommand
|
internal interface ICommand
|
||||||
{
|
{
|
||||||
@@ -11,5 +11,5 @@ internal interface ICommand
|
|||||||
bool HideFromHelp { get; }
|
bool HideFromHelp { get; }
|
||||||
UserRight RequiredRight { get; }
|
UserRight RequiredRight { get; }
|
||||||
|
|
||||||
Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx);
|
Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx);
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetKickBot.Settings;
|
using KfChatDotNetBot.Settings;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Commands;
|
namespace KfChatDotNetBot.Commands;
|
||||||
|
|
||||||
public class JuiceCommand : ICommand
|
public class JuiceCommand : ICommand
|
||||||
{
|
{
|
||||||
@@ -13,7 +13,7 @@ public class JuiceCommand : ICommand
|
|||||||
public string HelpText => "Get juice!";
|
public string HelpText => "Get juice!";
|
||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
await using var db = new ApplicationDbContext();
|
await using var db = new ApplicationDbContext();
|
||||||
var user = await db.Users.FirstOrDefaultAsync(u => u.KfId == message.Author.Id, cancellationToken: ctx);
|
var user = await db.Users.FirstOrDefaultAsync(u => u.KfId == message.Author.Id, cancellationToken: ctx);
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Commands;
|
namespace KfChatDotNetBot.Commands;
|
||||||
|
|
||||||
public class InsanityCommand : ICommand
|
public class InsanityCommand : ICommand
|
||||||
{
|
{
|
||||||
@@ -11,7 +11,7 @@ public class InsanityCommand : ICommand
|
|||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
|
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
// ReSharper disable once StringLiteralTypo
|
// ReSharper disable once StringLiteralTypo
|
||||||
botInstance.SendChatMessage("definition of insanity = doing the same thing over and over and over excecting a different result, and heres my dumbass trying to get rich every day and losing everythign i fucking touch every fucking time FUCK this bullshit FUCK MY LIEFdefinition of insanity = doing the same thing over and over and over excecting a different result, and heres my dumbass trying to get rich every day and losing everythign i fucking touch every fucking time FUCK this bullshit FUCK MY LIEF");
|
botInstance.SendChatMessage("definition of insanity = doing the same thing over and over and over excecting a different result, and heres my dumbass trying to get rich every day and losing everythign i fucking touch every fucking time FUCK this bullshit FUCK MY LIEFdefinition of insanity = doing the same thing over and over and over excecting a different result, and heres my dumbass trying to get rich every day and losing everythign i fucking touch every fucking time FUCK this bullshit FUCK MY LIEF");
|
||||||
@@ -25,7 +25,7 @@ public class TwistedCommand : ICommand
|
|||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
|
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
// ReSharper disable once StringLiteralTypo
|
// ReSharper disable once StringLiteralTypo
|
||||||
botInstance.SendChatMessage("🦍 🗣 GET IT TWISTED 🌪 , GAMBLE ✅ . PLEASE START GAMBLING 👍 . GAMBLING IS AN INVESTMENT 🎰 AND AN INVESTMENT ONLY 👍 . YOU WILL PROFIT 💰 , YOU WILL WIN ❗ ️. YOU WILL DO ALL OF THAT 💯 , YOU UNDERSTAND ⁉ ️ YOU WILL BECOME A BILLIONAIRE 💵 📈 AND REBUILD YOUR FUCKING LIFE 🤯");
|
botInstance.SendChatMessage("🦍 🗣 GET IT TWISTED 🌪 , GAMBLE ✅ . PLEASE START GAMBLING 👍 . GAMBLING IS AN INVESTMENT 🎰 AND AN INVESTMENT ONLY 👍 . YOU WILL PROFIT 💰 , YOU WILL WIN ❗ ️. YOU WILL DO ALL OF THAT 💯 , YOU UNDERSTAND ⁉ ️ YOU WILL BECOME A BILLIONAIRE 💵 📈 AND REBUILD YOUR FUCKING LIFE 🤯");
|
||||||
@@ -39,7 +39,7 @@ public class HelpMeCommand : ICommand
|
|||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
|
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
// ReSharper disable once StringLiteralTypo
|
// ReSharper disable once StringLiteralTypo
|
||||||
botInstance.SendChatMessage("[img]https://i.postimg.cc/fTw6tGWZ/ineedmoneydumbfuck.png[/img]", true);
|
botInstance.SendChatMessage("[img]https://i.postimg.cc/fTw6tGWZ/ineedmoneydumbfuck.png[/img]", true);
|
||||||
@@ -53,7 +53,7 @@ public class SentCommand : ICommand
|
|||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
|
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
// ReSharper disable once StringLiteralTypo
|
// ReSharper disable once StringLiteralTypo
|
||||||
botInstance.SendChatMessage("[img]https://i.ibb.co/GHq7hb1/4373-g-N5-HEH2-Hkc.png[/img]", true);
|
botInstance.SendChatMessage("[img]https://i.ibb.co/GHq7hb1/4373-g-N5-HEH2-Hkc.png[/img]", true);
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Commands;
|
namespace KfChatDotNetBot.Commands;
|
||||||
|
|
||||||
public class TimeCommand : ICommand
|
public class TimeCommand : ICommand
|
||||||
{
|
{
|
||||||
@@ -11,7 +11,7 @@ public class TimeCommand : ICommand
|
|||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
|
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
var bmt = new DateTimeOffset(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow,
|
var bmt = new DateTimeOffset(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow,
|
||||||
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").BaseUtcOffset);
|
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").BaseUtcOffset);
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Commands;
|
namespace KfChatDotNetBot.Commands;
|
||||||
|
|
||||||
public class WhoisCommand : ICommand
|
public class WhoisCommand : ICommand
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ public class WhoisCommand : ICommand
|
|||||||
public bool HideFromHelp => false;
|
public bool HideFromHelp => false;
|
||||||
public UserRight RequiredRight => UserRight.Guest;
|
public UserRight RequiredRight => UserRight.Guest;
|
||||||
|
|
||||||
public async Task RunCommand(KickBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
public async Task RunCommand(ChatBot botInstance, MessageModel message, GroupCollection arguments, CancellationToken ctx)
|
||||||
{
|
{
|
||||||
await using var db = new ApplicationDbContext();
|
await using var db = new ApplicationDbContext();
|
||||||
var query = arguments["user"].Value.TrimStart('@').TrimEnd(',').TrimEnd();
|
var query = arguments["user"].Value.TrimStart('@').TrimEnd(',').TrimEnd();
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot;
|
namespace KfChatDotNetBot;
|
||||||
|
|
||||||
public static class Extensions
|
public static class Extensions
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using KfChatDotNetKickBot;
|
using KfChatDotNetBot;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20240714132259_Initial")]
|
[Migration("20240714132259_Initial")]
|
||||||
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Initial : Migration
|
public partial class Initial : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using KfChatDotNetKickBot;
|
using KfChatDotNetBot;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20240716193646_Settings")]
|
[Migration("20240716193646_Settings")]
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Settings : Migration
|
public partial class Settings : Migration
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using KfChatDotNetKickBot;
|
using KfChatDotNetBot;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20240717110408_Howlgg")]
|
[Migration("20240717110408_Howlgg")]
|
||||||
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Howlgg : Migration
|
public partial class Howlgg : Migration
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
using KfChatDotNetKickBot;
|
using KfChatDotNetBot;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Migrations
|
namespace KfChatDotNetBot.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
public class BuiltInSettingsModel
|
public class BuiltInSettingsModel
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
public class ConfigModel
|
public class ConfigModel
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace KfChatDotNetKickBot.Models.DbModels;
|
namespace KfChatDotNetBot.Models.DbModels;
|
||||||
|
|
||||||
public class HowlggBetsDbModel
|
public class HowlggBetsDbModel
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace KfChatDotNetKickBot.Models.DbModels;
|
namespace KfChatDotNetBot.Models.DbModels;
|
||||||
|
|
||||||
public class JuicerDbModel
|
public class JuicerDbModel
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Models.DbModels;
|
namespace KfChatDotNetBot.Models.DbModels;
|
||||||
|
|
||||||
public class SettingDbModel
|
public class SettingDbModel
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Models.DbModels;
|
namespace KfChatDotNetBot.Models.DbModels;
|
||||||
|
|
||||||
public class UserDbModel
|
public class UserDbModel
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
public class HowlggBetHistoryResponseModel
|
public class HowlggBetHistoryResponseModel
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
public class JackpotWsPacketModel
|
public class JackpotWsPacketModel
|
||||||
{
|
{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
public class PocketWatchModel
|
public class PocketWatchModel
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
public class ShuffleLatestBetModel
|
public class ShuffleLatestBetModel
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Models;
|
namespace KfChatDotNetBot.Models;
|
||||||
|
|
||||||
public class ThreeXplEventModel
|
public class ThreeXplEventModel
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using KfChatDotNetKickBot.Settings;
|
using KfChatDotNetBot.Settings;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot
|
namespace KfChatDotNetBot
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
@@ -19,7 +19,7 @@ namespace KfChatDotNetKickBot
|
|||||||
BuiltIn.MigrateJsonSettingsToDb().Wait();
|
BuiltIn.MigrateJsonSettingsToDb().Wait();
|
||||||
logger.Info("Handing over to bot now");
|
logger.Info("Handing over to bot now");
|
||||||
Console.OutputEncoding = Encoding.UTF8;
|
Console.OutputEncoding = Encoding.UTF8;
|
||||||
new KickBot();
|
new ChatBot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
using Humanizer;
|
using Humanizer;
|
||||||
using KfChatDotNetKickBot.Commands;
|
using KfChatDotNetBot.Commands;
|
||||||
using KfChatDotNetWsClient.Models.Events;
|
using KfChatDotNetWsClient.Models.Events;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
// Took one look at GambaSesh's code, and it made my head explode
|
// Took one look at GambaSesh's code, and it made my head explode
|
||||||
// This implementation is inspired by similar bot I wrote years ago
|
// This implementation is inspired by similar bot I wrote years ago
|
||||||
internal class BotCommands
|
internal class BotCommands
|
||||||
{
|
{
|
||||||
private KickBot _bot;
|
private ChatBot _bot;
|
||||||
private Logger _logger = LogManager.GetCurrentClassLogger();
|
private Logger _logger = LogManager.GetCurrentClassLogger();
|
||||||
private char CommandPrefix = '!';
|
private char CommandPrefix = '!';
|
||||||
private IEnumerable<ICommand> Commands;
|
private IEnumerable<ICommand> Commands;
|
||||||
private CancellationToken _cancellationToken;
|
private CancellationToken _cancellationToken;
|
||||||
private List<Task> _commandTasks = [];
|
private List<Task> _commandTasks = [];
|
||||||
|
|
||||||
internal BotCommands(KickBot bot, CancellationToken? ctx = null)
|
internal BotCommands(ChatBot bot, CancellationToken? ctx = null)
|
||||||
{
|
{
|
||||||
_cancellationToken = ctx ?? CancellationToken.None;
|
_cancellationToken = ctx ?? CancellationToken.None;
|
||||||
_bot = bot;
|
_bot = bot;
|
||||||
@@ -5,7 +5,7 @@ using System.Text.Json.Serialization;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class DiscordService : IDisposable
|
public class DiscordService : IDisposable
|
||||||
{
|
{
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using KfChatDotNetKickBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class Howlgg : IDisposable
|
public class Howlgg : IDisposable
|
||||||
{
|
{
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using KfChatDotNetKickBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class Jackpot : IDisposable
|
public class Jackpot : IDisposable
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@ using System.Text.Json;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using PuppeteerSharp;
|
using PuppeteerSharp;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class KfTokenService
|
public class KfTokenService
|
||||||
{
|
{
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Net.WebSockets;
|
using System.Net.WebSockets;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using KfChatDotNetKickBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class Shuffle : IDisposable
|
public class Shuffle : IDisposable
|
||||||
{
|
{
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using KfChatDotNetKickBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class ThreeXplPocketWatch
|
public class ThreeXplPocketWatch
|
||||||
{
|
{
|
||||||
@@ -5,7 +5,7 @@ using System.Text.Json;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class Twitch : IDisposable
|
public class Twitch : IDisposable
|
||||||
{
|
{
|
||||||
@@ -5,7 +5,7 @@ using System.Text.RegularExpressions;
|
|||||||
using NLog;
|
using NLog;
|
||||||
using Websocket.Client;
|
using Websocket.Client;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Services;
|
namespace KfChatDotNetBot.Services;
|
||||||
|
|
||||||
public class TwitchChat : IDisposable
|
public class TwitchChat : IDisposable
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using KfChatDotNetKickBot.Models;
|
using KfChatDotNetBot.Models;
|
||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Settings;
|
namespace KfChatDotNetBot.Settings;
|
||||||
|
|
||||||
public static class BuiltIn
|
public static class BuiltIn
|
||||||
{
|
{
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Settings;
|
namespace KfChatDotNetBot.Settings;
|
||||||
|
|
||||||
public static class Helpers
|
public static class Helpers
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using KfChatDotNetKickBot.Models.DbModels;
|
using KfChatDotNetBot.Models.DbModels;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Settings;
|
namespace KfChatDotNetBot.Settings;
|
||||||
|
|
||||||
public class SettingValue(string? value, SettingDbModel? dbEntry)
|
public class SettingValue(string? value, SettingDbModel? dbEntry)
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
namespace KfChatDotNetKickBot.Settings;
|
namespace KfChatDotNetBot.Settings;
|
||||||
|
|
||||||
public static class Utils
|
public static class Utils
|
||||||
{
|
{
|
||||||
Reference in New Issue
Block a user