Compare commits
4 commits
66560bb769
...
a6c2ec0511
Author | SHA1 | Date | |
---|---|---|---|
a6c2ec0511 | |||
7399e8bac1 | |||
fe7445eefb | |||
d428fc5532 |
129 changed files with 146 additions and 392 deletions
|
@ -1,5 +1,4 @@
|
||||||
using Discord;
|
using Discord;
|
||||||
using EllieBot;
|
|
||||||
|
|
||||||
namespace EllieBot.Marmalade;
|
namespace EllieBot.Marmalade;
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ public sealed class Bot : IBot
|
||||||
// svcs.Components.Remove<IPlanner, Planner>();
|
// svcs.Components.Remove<IPlanner, Planner>();
|
||||||
// svcs.Components.Add<IPlanner, RemovablePlanner>();
|
// svcs.Components.Add<IPlanner, RemovablePlanner>();
|
||||||
|
|
||||||
svcs.AddSingleton<IBotCredentials, IBotCredentials>(_ => _credsProvider.GetCreds());
|
svcs.AddSingleton<IBotCredentials>(_ => _credsProvider.GetCreds());
|
||||||
svcs.AddSingleton<DbService, DbService>(_db);
|
svcs.AddSingleton<DbService, DbService>(_db);
|
||||||
svcs.AddSingleton<IBotCredsProvider>(_credsProvider);
|
svcs.AddSingleton<IBotCredsProvider>(_credsProvider);
|
||||||
svcs.AddSingleton<DiscordSocketClient>(Client);
|
svcs.AddSingleton<DiscordSocketClient>(Client);
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace EllieBot.Db.Models;
|
namespace EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using EllieBot.Db.Models;
|
|
||||||
|
|
||||||
namespace EllieBot.Migrations;
|
namespace EllieBot.Migrations;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace EllieBot.Migrations
|
namespace EllieBot.Migrations
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace EllieBot.Migrations
|
namespace EllieBot.Migrations
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace EllieBot.Migrations
|
namespace EllieBot.Migrations
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace EllieBot.Migrations
|
namespace EllieBot.Migrations
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace EllieBot.Migrations
|
namespace EllieBot.Migrations
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Administration._common.results;
|
using EllieBot.Modules.Administration._common.results;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ using System.Net;
|
||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Administration.Services;
|
namespace EllieBot.Modules.Administration.Services;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Db;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Administration.Services;
|
namespace EllieBot.Modules.Administration.Services;
|
||||||
|
|
||||||
public class GameVoiceChannelService : IEService
|
public class GameVoiceChannelService : IEService
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Administration.Services;
|
namespace EllieBot.Modules.Administration.Services;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Modules.Patronage;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
using OneOf.Types;
|
using OneOf.Types;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Patronage;
|
using EllieBot.Modules.Patronage;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using OneOf.Types;
|
using OneOf.Types;
|
||||||
|
|
|
@ -3,7 +3,6 @@ using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Administration;
|
namespace EllieBot.Modules.Administration;
|
||||||
|
|
||||||
|
|
|
@ -546,7 +546,7 @@ public partial class Administration
|
||||||
text = await repSvc.ReplaceAsync(text, repCtx);
|
text = await repSvc.ReplaceAsync(text, repCtx);
|
||||||
await Response().Channel(ch).Text(text).SendAsync();
|
await Response().Channel(ch).Text(text).SendAsync();
|
||||||
|
|
||||||
await ctx.OkAsync();;
|
await ctx.OkAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Administration.Services;
|
namespace EllieBot.Modules.Administration.Services;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Administration.Services;
|
using EllieBot.Modules.Administration.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ using LinqToDB.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Common.TypeReaders.Models;
|
using EllieBot.Common.TypeReaders.Models;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Permissions.Services;
|
using EllieBot.Modules.Permissions.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Administration.Services;
|
namespace EllieBot.Modules.Administration.Services;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Common.Yml;
|
using EllieBot.Common.Yml;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
|
|
|
@ -3,7 +3,6 @@ using EllieBot.Common.TypeReaders;
|
||||||
using EllieBot.Modules.Gambling.Common;
|
using EllieBot.Modules.Gambling.Common;
|
||||||
using EllieBot.Modules.Gambling.Common.Blackjack;
|
using EllieBot.Modules.Gambling.Common.Blackjack;
|
||||||
using EllieBot.Modules.Gambling.Services;
|
using EllieBot.Modules.Gambling.Services;
|
||||||
using EllieBot.Modules.Utility;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Gambling;
|
namespace EllieBot.Modules.Gambling;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ using System.Text;
|
||||||
using EllieBot.Modules.Gambling.Rps;
|
using EllieBot.Modules.Gambling.Rps;
|
||||||
using EllieBot.Common.TypeReaders;
|
using EllieBot.Common.TypeReaders;
|
||||||
using EllieBot.Modules.Patronage;
|
using EllieBot.Modules.Patronage;
|
||||||
using EllieBot.Modules.Utility;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Gambling;
|
namespace EllieBot.Modules.Gambling;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Gambling.Common;
|
using EllieBot.Modules.Gambling.Common;
|
||||||
using EllieBot.Modules.Gambling.Common.Connect4;
|
using EllieBot.Modules.Gambling.Common.Connect4;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using SixLabors.Fonts;
|
using SixLabors.Fonts;
|
||||||
using SixLabors.ImageSharp;
|
using SixLabors.ImageSharp;
|
||||||
|
@ -32,7 +31,6 @@ public class PlantPickService : IEService, IExecNoCommand
|
||||||
|
|
||||||
public PlantPickService(
|
public PlantPickService(
|
||||||
DbService db,
|
DbService db,
|
||||||
CommandHandler cmd,
|
|
||||||
IBotStrings strings,
|
IBotStrings strings,
|
||||||
IImageCache images,
|
IImageCache images,
|
||||||
FontProvider fonts,
|
FontProvider fonts,
|
||||||
|
@ -108,7 +106,6 @@ public class PlantPickService : IEService, IExecNoCommand
|
||||||
/// Get a random currency image stream, with an optional password sticked onto it.
|
/// Get a random currency image stream, with an optional password sticked onto it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pass">Optional password to add to top left corner.</param>
|
/// <param name="pass">Optional password to add to top left corner.</param>
|
||||||
/// <param name="extension">Extension of the file, defaults to png</param>
|
|
||||||
/// <returns>Stream of the currency image</returns>
|
/// <returns>Stream of the currency image</returns>
|
||||||
public async Task<(Stream, string)> GetRandomCurrencyImageAsync(string pass)
|
public async Task<(Stream, string)> GetRandomCurrencyImageAsync(string pass)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Gambling.Common;
|
using EllieBot.Modules.Gambling.Common;
|
||||||
using EllieBot.Modules.Gambling.Services;
|
using EllieBot.Modules.Gambling.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Gambling.Services;
|
namespace EllieBot.Modules.Gambling.Services;
|
||||||
|
|
|
@ -7,9 +7,7 @@ using SixLabors.ImageSharp;
|
||||||
using SixLabors.ImageSharp.Drawing.Processing;
|
using SixLabors.ImageSharp.Drawing.Processing;
|
||||||
using SixLabors.ImageSharp.PixelFormats;
|
using SixLabors.ImageSharp.PixelFormats;
|
||||||
using SixLabors.ImageSharp.Processing;
|
using SixLabors.ImageSharp.Processing;
|
||||||
using EllieBot.Modules.Gambling;
|
|
||||||
using EllieBot.Common.TypeReaders;
|
using EllieBot.Common.TypeReaders;
|
||||||
using EllieBot.Modules.Utility;
|
|
||||||
using Color = SixLabors.ImageSharp.Color;
|
using Color = SixLabors.ImageSharp.Color;
|
||||||
using Image = SixLabors.ImageSharp.Image;
|
using Image = SixLabors.ImageSharp.Image;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ using EllieBot.Modules.Gambling.Common;
|
||||||
using EllieBot.Modules.Gambling.Common.Waifu;
|
using EllieBot.Modules.Gambling.Common.Waifu;
|
||||||
using EllieBot.Modules.Gambling.Services;
|
using EllieBot.Modules.Gambling.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using TwitchLib.Api.Helix.Models.Teams;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Gambling;
|
namespace EllieBot.Modules.Gambling;
|
||||||
|
|
||||||
|
@ -153,12 +153,12 @@ public partial class Gambling
|
||||||
await Response().Confirm(strs.waifu_divorced_notlike(N(amount))).SendAsync();
|
await Response().Confirm(strs.waifu_divorced_notlike(N(amount))).SendAsync();
|
||||||
else if (result == DivorceResult.NotYourWife)
|
else if (result == DivorceResult.NotYourWife)
|
||||||
await Response().Error(strs.waifu_not_yours).SendAsync();
|
await Response().Error(strs.waifu_not_yours).SendAsync();
|
||||||
else
|
else if (remaining is { } rem)
|
||||||
{
|
{
|
||||||
await Response()
|
await Response()
|
||||||
.Error(strs.waifu_recent_divorce(
|
.Error(strs.waifu_recent_divorce(
|
||||||
Format.Bold(((int)remaining?.TotalHours).ToString()),
|
Format.Bold(((int)rem.TotalHours).ToString()),
|
||||||
Format.Bold(remaining?.Minutes.ToString())))
|
Format.Bold(rem.Minutes.ToString())))
|
||||||
.SendAsync();
|
.SendAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ public partial class Gambling
|
||||||
private string GetLbString(WaifuLbResult w)
|
private string GetLbString(WaifuLbResult w)
|
||||||
{
|
{
|
||||||
var claimer = "no one";
|
var claimer = "no one";
|
||||||
var status = string.Empty;
|
string status;
|
||||||
|
|
||||||
var waifuUsername = w.Username.TrimTo(20);
|
var waifuUsername = w.Username.TrimTo(20);
|
||||||
var claimerUsername = w.Claimer?.TrimTo(20);
|
var claimerUsername = w.Claimer?.TrimTo(20);
|
||||||
|
@ -377,7 +377,8 @@ public partial class Gambling
|
||||||
if (sucess)
|
if (sucess)
|
||||||
{
|
{
|
||||||
await Response()
|
await Response()
|
||||||
.Confirm(strs.waifu_gift(Format.Bold($"{GetCountString(items)}{items.Item} {items.Item.ItemEmoji}"),
|
.Confirm(strs.waifu_gift(
|
||||||
|
Format.Bold($"{GetCountString(items)}{items.Item} {items.Item.ItemEmoji}"),
|
||||||
Format.Bold(waifu.ToString())))
|
Format.Bold(waifu.ToString())))
|
||||||
.SendAsync();
|
.SendAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,9 @@ using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Gambling.Common;
|
using EllieBot.Modules.Gambling.Common;
|
||||||
using EllieBot.Modules.Gambling.Common.Waifu;
|
using EllieBot.Modules.Gambling.Common.Waifu;
|
||||||
using SixLabors.ImageSharp;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Gambling.Services;
|
namespace EllieBot.Modules.Gambling.Services;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Modules.Gambling;
|
|
||||||
using EllieBot.Modules.Gambling.Betdraw;
|
using EllieBot.Modules.Gambling.Betdraw;
|
||||||
using EllieBot.Modules.Gambling.Rps;
|
using EllieBot.Modules.Gambling.Rps;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Modules.Gambling;
|
|
||||||
using EllieBot.Modules.Gambling.Betdraw;
|
using EllieBot.Modules.Gambling.Betdraw;
|
||||||
using EllieBot.Modules.Gambling.Rps;
|
using EllieBot.Modules.Gambling.Rps;
|
||||||
using EllieBot.Modules.Gambling.Services;
|
using EllieBot.Modules.Gambling.Services;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Gambling.Services;
|
using EllieBot.Modules.Gambling.Services;
|
||||||
using NCalc;
|
using NCalc;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Games.Services;
|
using EllieBot.Modules.Games.Services;
|
||||||
using EllieBot.Db.Models;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Games;
|
namespace EllieBot.Modules.Games;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using System.CodeDom;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Games.Common.ChatterBot;
|
namespace EllieBot.Modules.Games.Common.ChatterBot;
|
||||||
|
|
||||||
public sealed class ThinkResult
|
public sealed class ThinkResult
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
|
||||||
using EllieBot.Modules.Games.Common;
|
using EllieBot.Modules.Games.Common;
|
||||||
using EllieBot.Modules.Games.Common.Acrophobia;
|
using EllieBot.Modules.Games.Common.Acrophobia;
|
||||||
using EllieBot.Modules.Games.Common.Nunchi;
|
using EllieBot.Modules.Games.Common.Nunchi;
|
||||||
|
@ -8,11 +7,10 @@ using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Games.Services;
|
namespace EllieBot.Modules.Games.Services;
|
||||||
|
|
||||||
public class GamesService : IEService, IReadyExecutor
|
public class GamesService : IEService
|
||||||
{
|
{
|
||||||
private const string TYPING_ARTICLES_PATH = "data/typing_articles3.json";
|
private const string TYPING_ARTICLES_PATH = "data/typing_articles3.json";
|
||||||
|
|
||||||
public ConcurrentDictionary<ulong, GirlRating> GirlRatings { get; } = new();
|
|
||||||
|
|
||||||
public IReadOnlyList<string> EightBallResponses
|
public IReadOnlyList<string> EightBallResponses
|
||||||
=> _gamesConfig.Data.EightBallResponses;
|
=> _gamesConfig.Data.EightBallResponses;
|
||||||
|
@ -25,7 +23,6 @@ public class GamesService : IEService, IReadyExecutor
|
||||||
public ConcurrentDictionary<ulong, TypingGame> RunningContests { get; } = new();
|
public ConcurrentDictionary<ulong, TypingGame> RunningContests { get; } = new();
|
||||||
public ConcurrentDictionary<ulong, NunchiGame> NunchiGames { get; } = new();
|
public ConcurrentDictionary<ulong, NunchiGame> NunchiGames { get; } = new();
|
||||||
|
|
||||||
public AsyncLazy<RatingTexts> Ratings { get; }
|
|
||||||
private readonly GamesConfigService _gamesConfig;
|
private readonly GamesConfigService _gamesConfig;
|
||||||
|
|
||||||
private readonly IHttpClientFactory _httpFactory;
|
private readonly IHttpClientFactory _httpFactory;
|
||||||
|
@ -41,7 +38,6 @@ public class GamesService : IEService, IReadyExecutor
|
||||||
SizeLimit = 500_000
|
SizeLimit = 500_000
|
||||||
});
|
});
|
||||||
|
|
||||||
Ratings = new(GetRatingTexts);
|
|
||||||
_rng = new EllieRandom();
|
_rng = new EllieRandom();
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -55,22 +51,6 @@ public class GamesService : IEService, IReadyExecutor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OnReadyAsync()
|
|
||||||
{
|
|
||||||
// reset rating once a day
|
|
||||||
using var timer = new PeriodicTimer(TimeSpan.FromDays(1));
|
|
||||||
while (await timer.WaitForNextTickAsync())
|
|
||||||
GirlRatings.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<RatingTexts> GetRatingTexts()
|
|
||||||
{
|
|
||||||
using var http = _httpFactory.CreateClient();
|
|
||||||
var text = await http.GetStringAsync(
|
|
||||||
"https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/rategirl/rates.json");
|
|
||||||
return JsonConvert.DeserializeObject<RatingTexts>(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddTypingArticle(IUser user, string text)
|
public void AddTypingArticle(IUser user, string text)
|
||||||
{
|
{
|
||||||
TypingArticles.Add(new()
|
TypingArticles.Add(new()
|
||||||
|
@ -104,15 +84,4 @@ public class GamesService : IEService, IReadyExecutor
|
||||||
File.WriteAllText(TYPING_ARTICLES_PATH, JsonConvert.SerializeObject(articles));
|
File.WriteAllText(TYPING_ARTICLES_PATH, JsonConvert.SerializeObject(articles));
|
||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RatingTexts
|
|
||||||
{
|
|
||||||
public string Nog { get; set; }
|
|
||||||
public string Tra { get; set; }
|
|
||||||
public string Fun { get; set; }
|
|
||||||
public string Uni { get; set; }
|
|
||||||
public string Wif { get; set; }
|
|
||||||
public string Dat { get; set; }
|
|
||||||
public string Dan { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,61 +0,0 @@
|
||||||
#nullable disable
|
|
||||||
using SixLabors.ImageSharp;
|
|
||||||
using SixLabors.ImageSharp.Processing;
|
|
||||||
using Image = SixLabors.ImageSharp.Image;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Games.Common;
|
|
||||||
|
|
||||||
public class GirlRating
|
|
||||||
{
|
|
||||||
public double Crazy { get; }
|
|
||||||
public double Hot { get; }
|
|
||||||
public int Roll { get; }
|
|
||||||
public string Advice { get; }
|
|
||||||
|
|
||||||
public AsyncLazy<Stream> Stream { get; }
|
|
||||||
private readonly IImageCache _images;
|
|
||||||
|
|
||||||
public GirlRating(
|
|
||||||
IImageCache images,
|
|
||||||
double crazy,
|
|
||||||
double hot,
|
|
||||||
int roll,
|
|
||||||
string advice)
|
|
||||||
{
|
|
||||||
_images = images;
|
|
||||||
Crazy = crazy;
|
|
||||||
Hot = hot;
|
|
||||||
Roll = roll;
|
|
||||||
Advice = advice; // convenient to have it here, even though atm there are only few different ones.
|
|
||||||
|
|
||||||
Stream = new(async () =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var bgBytes = await _images.GetRategirlBgAsync();
|
|
||||||
using var img = Image.Load(bgBytes);
|
|
||||||
const int minx = 35;
|
|
||||||
const int miny = 385;
|
|
||||||
const int length = 345;
|
|
||||||
|
|
||||||
var pointx = (int)(minx + (length * (Hot / 10)));
|
|
||||||
var pointy = (int)(miny - (length * ((Crazy - 4) / 6)));
|
|
||||||
|
|
||||||
var dotBytes = await _images.GetRategirlDotAsync();
|
|
||||||
using (var pointImg = Image.Load(dotBytes))
|
|
||||||
{
|
|
||||||
img.Mutate(x => x.DrawImage(pointImg, new(pointx - 10, pointy - 10), new GraphicsOptions()));
|
|
||||||
}
|
|
||||||
|
|
||||||
var imgStream = new MemoryStream();
|
|
||||||
img.SaveAsPng(imgStream);
|
|
||||||
return imgStream;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.Warning(ex, "Error getting RateGirl image");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -107,9 +107,9 @@ public partial class Games
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private EmbedBuilder? questionEmbed = null;
|
private EmbedBuilder? questionEmbed;
|
||||||
private IUserMessage? questionMessage = null;
|
private IUserMessage? questionMessage;
|
||||||
private bool showHowToQuit = false;
|
private bool showHowToQuit;
|
||||||
|
|
||||||
private void RegisterEvents(TriviaGame trivia)
|
private void RegisterEvents(TriviaGame trivia)
|
||||||
{
|
{
|
|
@ -11,12 +11,19 @@ public sealed class TriviaGame
|
||||||
private readonly IQuestionPool _questionPool;
|
private readonly IQuestionPool _questionPool;
|
||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
|
|
||||||
public event Func<TriviaGame, TriviaQuestion, Task> OnQuestion = static delegate { return Task.CompletedTask; };
|
public event Func<TriviaGame, TriviaQuestion, Task> OnQuestion = static delegate { return Task.CompletedTask; };
|
||||||
public event Func<TriviaGame, TriviaQuestion, Task> OnHint = static delegate { return Task.CompletedTask; };
|
public event Func<TriviaGame, TriviaQuestion, Task> OnHint = static delegate { return Task.CompletedTask; };
|
||||||
public event Func<TriviaGame, Task> OnStats = static delegate { return Task.CompletedTask; };
|
public event Func<TriviaGame, Task> OnStats = static delegate { return Task.CompletedTask; };
|
||||||
public event Func<TriviaGame, TriviaUser, TriviaQuestion, bool, Task> OnGuess = static delegate { return Task.CompletedTask; };
|
|
||||||
|
public event Func<TriviaGame, TriviaUser, TriviaQuestion, bool, Task> OnGuess = static delegate
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
};
|
||||||
|
|
||||||
public event Func<TriviaGame, TriviaQuestion, Task> OnTimeout = static delegate { return Task.CompletedTask; };
|
public event Func<TriviaGame, TriviaQuestion, Task> OnTimeout = static delegate { return Task.CompletedTask; };
|
||||||
public event Func<TriviaGame, Task> OnEnded = static delegate { return Task.CompletedTask; };
|
public event Func<TriviaGame, Task> OnEnded = static delegate { return Task.CompletedTask; };
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private bool _isStopped;
|
private bool _isStopped;
|
||||||
|
@ -24,7 +31,7 @@ public sealed class TriviaGame
|
||||||
public TriviaQuestion? CurrentQuestion { get; set; }
|
public TriviaQuestion? CurrentQuestion { get; set; }
|
||||||
|
|
||||||
|
|
||||||
private readonly ConcurrentDictionary<ulong, int> _users = new ();
|
private readonly ConcurrentDictionary<ulong, int> _users = new();
|
||||||
|
|
||||||
private readonly Channel<(TriviaUser User, string Input)> _inputs
|
private readonly Channel<(TriviaUser User, string Input)> _inputs
|
||||||
= Channel.CreateUnbounded<(TriviaUser, string)>(new UnboundedChannelOptions
|
= Channel.CreateUnbounded<(TriviaUser, string)>(new UnboundedChannelOptions
|
||||||
|
@ -41,8 +48,8 @@ public sealed class TriviaGame
|
||||||
_questionPool = _opts.IsPokemon
|
_questionPool = _opts.IsPokemon
|
||||||
? new PokemonQuestionPool(cache)
|
? new PokemonQuestionPool(cache)
|
||||||
: new DefaultQuestionPool(cache);
|
: new DefaultQuestionPool(cache);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RunAsync()
|
public async Task RunAsync()
|
||||||
{
|
{
|
||||||
await GameLoop();
|
await GameLoop();
|
||||||
|
@ -50,7 +57,8 @@ public sealed class TriviaGame
|
||||||
|
|
||||||
private async Task GameLoop()
|
private async Task GameLoop()
|
||||||
{
|
{
|
||||||
Task TimeOutFactory() => Task.Delay(_opts.QuestionTimer * 1000 / 2);
|
Task TimeOutFactory()
|
||||||
|
=> Task.Delay(_opts.QuestionTimer * 1000 / 2);
|
||||||
|
|
||||||
var errorCount = 0;
|
var errorCount = 0;
|
||||||
var inactivity = 0;
|
var inactivity = 0;
|
||||||
|
@ -91,7 +99,8 @@ public sealed class TriviaGame
|
||||||
{
|
{
|
||||||
// clear out all of the past guesses
|
// clear out all of the past guesses
|
||||||
while (_inputs.Reader.TryRead(out _))
|
while (_inputs.Reader.TryRead(out _))
|
||||||
;
|
{
|
||||||
|
}
|
||||||
|
|
||||||
await OnQuestion(this, question);
|
await OnQuestion(this, question);
|
||||||
}
|
}
|
||||||
|
@ -213,7 +222,7 @@ public sealed class TriviaGame
|
||||||
|
|
||||||
public async Task TriggerQuestionAsync()
|
public async Task TriggerQuestionAsync()
|
||||||
{
|
{
|
||||||
if(CurrentQuestion is TriviaQuestion q)
|
if (CurrentQuestion is TriviaQuestion q)
|
||||||
await OnQuestion(this, q);
|
await OnQuestion(this, q);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Modules.Music.Services;
|
using EllieBot.Modules.Music.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Utility;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Music;
|
namespace EllieBot.Modules.Music;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Music.Services;
|
using EllieBot.Modules.Music.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using EllieBot.Db;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Db.Models;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Music.Services;
|
namespace EllieBot.Modules.Music.Services;
|
||||||
|
|
|
@ -61,8 +61,8 @@ public class RadioResolver : IRadioResolver
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var m = _m3URegex.Match(file);
|
var m = _m3URegex.Match(file);
|
||||||
var res = m.Groups["url"]?.ToString();
|
var res = m.Groups["url"].ToString();
|
||||||
return res?.Trim();
|
return res.Trim();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -76,8 +76,8 @@ public class RadioResolver : IRadioResolver
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var m = _asxRegex.Match(file);
|
var m = _asxRegex.Match(file);
|
||||||
var res = m.Groups["url"]?.ToString();
|
var res = m.Groups["url"].ToString();
|
||||||
return res?.Trim();
|
return res.Trim();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -91,8 +91,8 @@ public class RadioResolver : IRadioResolver
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var m = _xspfRegex.Match(file);
|
var m = _xspfRegex.Match(file);
|
||||||
var res = m.Groups["url"]?.ToString();
|
var res = m.Groups["url"].ToString();
|
||||||
return res?.Trim();
|
return res.Trim();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using StackExchange.Redis;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Patronage;
|
namespace EllieBot.Modules.Patronage;
|
||||||
|
|
||||||
|
@ -21,16 +19,11 @@ public sealed class PatronageService
|
||||||
public int Priority
|
public int Priority
|
||||||
=> int.MinValue;
|
=> int.MinValue;
|
||||||
|
|
||||||
private static readonly PatronTier[] _tiers = Enum.GetValues<PatronTier>();
|
|
||||||
|
|
||||||
private readonly PatronageConfig _pConf;
|
private readonly PatronageConfig _pConf;
|
||||||
private readonly DbService _db;
|
private readonly DbService _db;
|
||||||
private readonly DiscordSocketClient _client;
|
private readonly DiscordSocketClient _client;
|
||||||
private readonly ISubscriptionHandler _subsHandler;
|
private readonly ISubscriptionHandler _subsHandler;
|
||||||
|
|
||||||
private static readonly TypedKey<long> _quotaKey
|
|
||||||
= new($"quota:last_hourly_reset");
|
|
||||||
|
|
||||||
private readonly IBotCache _cache;
|
private readonly IBotCache _cache;
|
||||||
private readonly IBotCredsProvider _creds;
|
private readonly IBotCredsProvider _creds;
|
||||||
private readonly IMessageSenderService _sender;
|
private readonly IMessageSenderService _sender;
|
||||||
|
@ -135,7 +128,7 @@ public sealed class PatronageService
|
||||||
// user is charged again for this month
|
// user is charged again for this month
|
||||||
// if his sub would end in teh future, extend it by one month.
|
// if his sub would end in teh future, extend it by one month.
|
||||||
// if it's not, just add 1 month to the last charge date
|
// if it's not, just add 1 month to the last charge date
|
||||||
var count = await ctx.GetTable<PatronUser>()
|
await ctx.GetTable<PatronUser>()
|
||||||
.Where(x => x.UniquePlatformUserId
|
.Where(x => x.UniquePlatformUserId
|
||||||
== subscriber.UniquePlatformUserId)
|
== subscriber.UniquePlatformUserId)
|
||||||
.UpdateAsync(old => new()
|
.UpdateAsync(old => new()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Permissions.Services;
|
namespace EllieBot.Modules.Permissions.Services;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.TypeReaders;
|
using EllieBot.Common.TypeReaders;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Permissions.Services;
|
using EllieBot.Modules.Permissions.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Permissions.Services;
|
using EllieBot.Modules.Permissions.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Permissions.Services;
|
namespace EllieBot.Modules.Permissions.Services;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using EllieBot.Common.TypeReaders;
|
using EllieBot.Common.TypeReaders;
|
||||||
using EllieBot.Common.TypeReaders.Models;
|
using EllieBot.Common.TypeReaders.Models;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Permissions.Common;
|
using EllieBot.Modules.Permissions.Common;
|
||||||
using EllieBot.Modules.Permissions.Services;
|
using EllieBot.Modules.Permissions.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Permissions.Common;
|
using EllieBot.Modules.Permissions.Common;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
|
@ -65,18 +65,6 @@ public partial class Searches
|
||||||
var change = (stock.Price - stock.Close).ToString("N2", Culture);
|
var change = (stock.Price - stock.Close).ToString("N2", Culture);
|
||||||
var changePercent = (1 - (stock.Close / stock.Price)).ToString("P1", Culture);
|
var changePercent = (1 - (stock.Close / stock.Price)).ToString("P1", Culture);
|
||||||
|
|
||||||
var sign50 = stock.Change50d >= 0
|
|
||||||
? "\\🔼"
|
|
||||||
: "\\🔻";
|
|
||||||
|
|
||||||
var change50 = (stock.Change50d).ToString("P1", Culture);
|
|
||||||
|
|
||||||
var sign200 = stock.Change200d >= 0
|
|
||||||
? "\\🔼"
|
|
||||||
: "\\🔻";
|
|
||||||
|
|
||||||
var change200 = (stock.Change200d).ToString("P1", Culture);
|
|
||||||
|
|
||||||
var price = stock.Price.ToString("C2", localCulture);
|
var price = stock.Price.ToString("C2", localCulture);
|
||||||
|
|
||||||
var eb = _sender.CreateEmbed()
|
var eb = _sender.CreateEmbed()
|
||||||
|
|
|
@ -4,13 +4,11 @@ using SixLabors.ImageSharp;
|
||||||
using SixLabors.ImageSharp.Drawing.Processing;
|
using SixLabors.ImageSharp.Drawing.Processing;
|
||||||
using SixLabors.ImageSharp.PixelFormats;
|
using SixLabors.ImageSharp.PixelFormats;
|
||||||
using SixLabors.ImageSharp.Processing;
|
using SixLabors.ImageSharp.Processing;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Color = SixLabors.ImageSharp.Color;
|
using Color = SixLabors.ImageSharp.Color;
|
||||||
using StringExtensions = EllieBot.Extensions.StringExtensions;
|
|
||||||
|
|
||||||
namespace EllieBot.Modules.Searches.Services;
|
namespace EllieBot.Modules.Searches.Services;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using AngleSharp;
|
using AngleSharp;
|
||||||
using CsvHelper;
|
using CsvHelper;
|
||||||
using CsvHelper.Configuration;
|
using CsvHelper.Configuration;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ using CodeHollow.FeedReader.Feeds;
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Searches.Services;
|
namespace EllieBot.Modules.Searches.Services;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using EllieBot.Modules.Searches.Common;
|
using OneOf;
|
||||||
using OneOf;
|
|
||||||
using OneOf.Types;
|
using OneOf.Types;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Searches.Services;
|
using EllieBot.Modules.Searches.Services;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using EllieBot.Modules.Searches.Common;
|
using EllieBot.Modules.Searches.Common;
|
||||||
using EllieBot.Modules.Searches.Common.StreamNotifications;
|
using EllieBot.Modules.Searches.Common.StreamNotifications;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using EllieBot.Modules.Administration;
|
namespace EllieBot.Modules.Utility;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Utility;
|
|
||||||
|
|
||||||
public partial class UtilityCommands
|
public partial class UtilityCommands
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Modules.Utility.Services;
|
using EllieBot.Modules.Utility.Services;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#nullable disable
|
#nullable disable
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Common.ModuleBehaviors;
|
using EllieBot.Common.ModuleBehaviors;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Modules.Utility.Services;
|
namespace EllieBot.Modules.Utility.Services;
|
||||||
|
|
|
@ -19,7 +19,6 @@ public sealed class GiveawayService : IEService, IReadyExecutor
|
||||||
private readonly IMemoryCache _cache;
|
private readonly IMemoryCache _cache;
|
||||||
private SortedSet<GiveawayModel> _giveawayCache = new SortedSet<GiveawayModel>();
|
private SortedSet<GiveawayModel> _giveawayCache = new SortedSet<GiveawayModel>();
|
||||||
private readonly EllieRandom _rng;
|
private readonly EllieRandom _rng;
|
||||||
private readonly ConcurrentDictionary<int, GiveawayRerollData> _rerolls = new();
|
|
||||||
|
|
||||||
public GiveawayService(DbService db, IBotCredentials creds, DiscordSocketClient client,
|
public GiveawayService(DbService db, IBotCredentials creds, DiscordSocketClient client,
|
||||||
IMessageSenderService sender, IBotStrings strings, ILocalization localization, IMemoryCache cache)
|
IMessageSenderService sender, IBotStrings strings, ILocalization localization, IMemoryCache cache)
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using EllieBot.Common.Yml;
|
using EllieBot.Common.Yml;
|
||||||
using EllieBot.Db;
|
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
using YamlDotNet.Serialization;
|
using YamlDotNet.Serialization;
|
||||||
using YamlDotNet.Serialization.NamingConventions;
|
using YamlDotNet.Serialization.NamingConventions;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue