mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
moved some stuff around to better reflect the code organization, hopefully
This commit is contained in:
committed by
Roberto Anić Banić
parent
6d3ac6c767
commit
833fa16ca9
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Attributes;
|
||||
using CompatBot.Commands.Attributes;
|
||||
using CompatBot.Database;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
|
||||
@@ -3,7 +3,7 @@ using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace CompatBot.Attributes
|
||||
namespace CompatBot.Commands.Attributes
|
||||
{
|
||||
internal abstract class CheckBaseAttributeWithReactions: CheckBaseAttribute
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using DSharpPlus.CommandsNext;
|
||||
|
||||
namespace CompatBot.Attributes
|
||||
namespace CompatBot.Commands.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
|
||||
internal class RequiresBotModRole: CheckBaseAttributeWithReactions
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using DSharpPlus.CommandsNext;
|
||||
|
||||
namespace CompatBot.Attributes
|
||||
namespace CompatBot.Commands.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
|
||||
internal class RequiresBotSudoerRole: CheckBaseAttributeWithReactions
|
||||
@@ -3,7 +3,7 @@ using System.Threading.Tasks;
|
||||
using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
|
||||
namespace CompatBot.Attributes
|
||||
namespace CompatBot.Commands.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
|
||||
internal class RequiresDm: CheckBaseAttribute
|
||||
@@ -7,7 +7,7 @@ using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Converters;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace CompatBot.Converters
|
||||
namespace CompatBot.Commands.Converters
|
||||
{
|
||||
internal sealed class CustomDiscordChannelConverter : IArgumentConverter<DiscordChannel>
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Attributes;
|
||||
using CompatBot.Commands.Attributes;
|
||||
using CompatBot.Database;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Converters;
|
||||
using CompatBot.Commands.Converters;
|
||||
using CompatBot.Database;
|
||||
using DSharpPlus;
|
||||
using DSharpPlus.CommandsNext;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Attributes;
|
||||
using CompatBot.Commands.Attributes;
|
||||
using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
@@ -3,9 +3,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompatApiClient;
|
||||
using CompatBot.Attributes;
|
||||
using CompatBot.Commands.Attributes;
|
||||
using CompatBot.Database;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus.CommandsNext;
|
||||
using DSharpPlus.CommandsNext.Attributes;
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompatApiClient;
|
||||
using CompatBot.Attributes;
|
||||
using CompatBot.Commands.Attributes;
|
||||
using CompatBot.Database;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus;
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Database;
|
||||
|
||||
namespace CompatBot.Providers
|
||||
namespace CompatBot.Database.Providers
|
||||
{
|
||||
internal static class ModProvider
|
||||
{
|
||||
@@ -2,11 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NReco.Text;
|
||||
|
||||
namespace CompatBot.Providers
|
||||
namespace CompatBot.Database.Providers
|
||||
{
|
||||
internal static class PiracyStringProvider
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using CompatApiClient;
|
||||
using CompatBot.Commands;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
@@ -4,8 +4,9 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CompatApiClient;
|
||||
using CompatBot.Commands;
|
||||
using CompatBot.LogParsing;
|
||||
using CompatBot.LogParsing.SourceHandlers;
|
||||
using CompatBot.EventHandlers.LogParsing;
|
||||
using CompatBot.EventHandlers.LogParsing.POCOs;
|
||||
using CompatBot.EventHandlers.LogParsing.SourceHandlers;
|
||||
using CompatBot.ResultFormatters;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus;
|
||||
|
||||
@@ -3,9 +3,10 @@ using System.Collections.Specialized;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Providers;
|
||||
using CompatBot.Database.Providers;
|
||||
using CompatBot.EventHandlers.LogParsing.POCOs;
|
||||
|
||||
namespace CompatBot.LogParsing
|
||||
namespace CompatBot.EventHandlers.LogParsing
|
||||
{
|
||||
internal partial class LogParser
|
||||
{
|
||||
@@ -4,9 +4,10 @@ using System.Collections.Generic;
|
||||
using System.IO.Pipelines;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.EventHandlers.LogParsing.POCOs;
|
||||
using CompatBot.Utils;
|
||||
|
||||
namespace CompatBot.LogParsing
|
||||
namespace CompatBot.EventHandlers.LogParsing
|
||||
{
|
||||
internal static partial class LogParser
|
||||
{
|
||||
@@ -5,9 +5,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.EventHandlers.LogParsing.POCOs;
|
||||
using NReco.Text;
|
||||
|
||||
namespace CompatBot.LogParsing
|
||||
namespace CompatBot.EventHandlers.LogParsing
|
||||
{
|
||||
using SectionAction = KeyValuePair<string, Action<string, LogParseState>>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace CompatBot.LogParsing
|
||||
namespace CompatBot.EventHandlers.LogParsing.POCOs
|
||||
{
|
||||
internal class LogParseState
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompatBot.LogParsing
|
||||
namespace CompatBot.EventHandlers.LogParsing.POCOs
|
||||
{
|
||||
internal class LogSection
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace CompatBot.LogParsing.SourceHandlers
|
||||
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
public class GzipHandler: ISourceHandler
|
||||
{
|
||||
@@ -28,7 +28,7 @@ namespace CompatBot.LogParsing.SourceHandlers
|
||||
{
|
||||
var memory = writer.GetMemory(Config.MinimumBufferSize);
|
||||
read = await gzipStream.ReadAsync(memory, Config.Cts.Token);
|
||||
writer.Advance(read); //todo: test that .Advance(0) works as expected
|
||||
writer.Advance(read);
|
||||
flushed = await writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
|
||||
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || Config.Cts.IsCancellationRequested));
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace CompatBot.LogParsing.SourceHandlers
|
||||
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
internal interface ISourceHandler
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace CompatBot.LogParsing.SourceHandlers
|
||||
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
public class PlainTextHandler: ISourceHandler
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace CompatBot.LogParsing.SourceHandlers
|
||||
{
|
||||
var memory = writer.GetMemory(Config.MinimumBufferSize);
|
||||
read = await stream.ReadAsync(memory, Config.Cts.Token);
|
||||
writer.Advance(read); //todo: test that .Advance(0) works as expected
|
||||
writer.Advance(read);
|
||||
flushed = await writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
|
||||
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || Config.Cts.IsCancellationRequested));
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
|
||||
using CompatBot.Utils;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
namespace CompatBot.LogParsing.SourceHandlers
|
||||
namespace CompatBot.EventHandlers.LogParsing.SourceHandlers
|
||||
{
|
||||
public class ZipHandler: ISourceHandler
|
||||
{
|
||||
@@ -65,7 +65,7 @@ namespace CompatBot.LogParsing.SourceHandlers
|
||||
{
|
||||
var memory = writer.GetMemory(Config.MinimumBufferSize);
|
||||
read = await zipStream.ReadAsync(memory, Config.Cts.Token);
|
||||
writer.Advance(read); //todo: test that .Advance(0) works as expected
|
||||
writer.Advance(read);
|
||||
flushed = await writer.FlushAsync(Config.Cts.Token).ConfigureAwait(false);
|
||||
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || Config.Cts.IsCancellationRequested));
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CompatBot.Commands;
|
||||
using CompatBot.Converters;
|
||||
using CompatBot.Commands.Converters;
|
||||
using CompatBot.Database;
|
||||
using CompatBot.EventHandlers;
|
||||
using DSharpPlus;
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
using CompatApiClient;
|
||||
using CompatApiClient.POCOs;
|
||||
using CompatBot.EventHandlers;
|
||||
using CompatBot.LogParsing;
|
||||
using CompatBot.EventHandlers.LogParsing.POCOs;
|
||||
using DSharpPlus;
|
||||
using DSharpPlus.Entities;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user