Fixed a few things
This commit is contained in:
parent
feb074a392
commit
f4690ca004
13 changed files with 16 additions and 16 deletions
|
@ -1,7 +1,7 @@
|
|||
namespace Ellie.Common.Attributes;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public sealed class NadekoOptionsAttribute<TOption> : Attribute
|
||||
public sealed class EllieOptionsAttribute<TOption> : Attribute
|
||||
where TOption: IEllieCommandOptions
|
||||
{
|
||||
}
|
|
@ -12,7 +12,7 @@ public sealed class OnlyPublicBotAttribute : PreconditionAttribute
|
|||
CommandInfo command,
|
||||
IServiceProvider services)
|
||||
{
|
||||
#if GLOBAL_NADEKO || DEBUG
|
||||
#if GLOBAL_ELLIE || DEBUG
|
||||
return Task.FromResult(PreconditionResult.FromSuccess());
|
||||
#else
|
||||
return Task.FromResult(PreconditionResult.FromError("Only available on the public bot."));
|
||||
|
|
|
@ -13,7 +13,7 @@ public class DownloadTracker : IEService
|
|||
/// <returns>Task representing download state</returns>
|
||||
public async Task EnsureUsersDownloadedAsync(IGuild guild)
|
||||
{
|
||||
#if GLOBAL_NADEKO
|
||||
#if GLOBAL_ELLIE
|
||||
return;
|
||||
#endif
|
||||
await _downloadUsersSemaphore.WaitAsync();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using Ellie.Db;
|
||||
using Ellie.Db.Models;
|
||||
// todo fix these namespaces. It should only be Nadeko.Bot.Db
|
||||
// todo fix these namespaces. It should only be Ellie.Bot.Db
|
||||
using Ellie.Services.Database;
|
||||
|
||||
namespace Ellie.Extensions;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/// <summary>
|
||||
/// This interface's method is executed after the command successfully finished execution.
|
||||
/// ***There is no support for this method in NadekoBot services.***
|
||||
/// ***There is no support for this method in Ellie services.***
|
||||
/// It is only meant to be used in medusa system
|
||||
/// </summary>
|
||||
public interface IExecPostCommand : IBehavior
|
||||
|
|
|
@ -224,7 +224,7 @@ public class CommandHandler : IEService, IReadyExecutor, ICommandHandler
|
|||
{
|
||||
try
|
||||
{
|
||||
#if !GLOBAL_NADEKO
|
||||
#if !GLOBAL_ELLIE
|
||||
// track how many messages each user is sending
|
||||
UserMessagesSent.AddOrUpdate(usrMsg.Author.Id, 1, (_, old) => ++old);
|
||||
#endif
|
||||
|
|
|
@ -51,7 +51,7 @@ public sealed class CommandsUtilityService : ICommandsUtilityService, IEService
|
|||
.WithFooter(GetText(strs.module(com.Module.GetTopLevelModule().Name), guild))
|
||||
.WithOkColor();
|
||||
|
||||
var opt = GetNadekoOptionType(com.Attributes);
|
||||
var opt = GetEllieOptionType(com.Attributes);
|
||||
if (opt is not null)
|
||||
{
|
||||
var hs = GetCommandOptionHelp(opt);
|
||||
|
@ -90,11 +90,11 @@ public sealed class CommandsUtilityService : ICommandsUtilityService, IEService
|
|||
return strs;
|
||||
}
|
||||
|
||||
public static Type? GetNadekoOptionType(IEnumerable<Attribute> attributes)
|
||||
public static Type? GetEllieOptionType(IEnumerable<Attribute> attributes)
|
||||
=> attributes
|
||||
.Select(a => a.GetType())
|
||||
.Where(a => a.IsGenericType
|
||||
&& a.GetGenericTypeDefinition() == typeof(NadekoOptionsAttribute<>))
|
||||
&& a.GetGenericTypeDefinition() == typeof(EllieOptionsAttribute<>))
|
||||
.Select(a => a.GenericTypeArguments[0])
|
||||
.FirstOrDefault();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using Humanizer.Localisation;
|
|||
using Ellie.Common.ModuleBehaviors;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace NadekoBot.Services;
|
||||
namespace Ellie.Services;
|
||||
|
||||
public sealed class StatsService : IStatsService, IReadyExecutor, IEService
|
||||
{
|
||||
|
|
|
@ -87,7 +87,7 @@ public class BotStrings : IBotStrings
|
|||
}
|
||||
|
||||
// Log.Warning(@"'{CommandName}' command strings don't exist in '{LanguageName}' culture.
|
||||
// This message is safe to ignore, however you can ask in Nadeko support server how you can contribute command translations",
|
||||
// This message is safe to ignore, however you can ask in Ellie support server how you can contribute command translations",
|
||||
// commandName, cultureInfo.Name);
|
||||
|
||||
return GetCommandStrings(commandName, _usCultureInfo);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code temporarily yeeted from
|
||||
// https://github.com/mostmand/Cloneable/blob/master/Cloneable/CloneableGenerator.cs
|
||||
// because of NRT issue
|
||||
#nullable disable
|
||||
#nullable enable
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Coordinator project
|
||||
|
||||
Grpc-based coordinator useful for sharded NadekoBot. Its purpose is controlling the lifetime and checking status of the shards it creates.
|
||||
Grpc-based coordinator useful for sharded Ellie. Its purpose is controlling the lifetime and checking status of the shards it creates.
|
||||
|
||||
|
||||
### Supports
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace Ellie.Coordinator
|
|||
lock (locker)
|
||||
{
|
||||
var shardIds = Enumerable.Range(0, 1) // shard 0 is always first
|
||||
.Append((int)((117523346618318850 >> 22) % _config.TotalShards)) // then nadeko server shard
|
||||
.Append((int)((117523346618318850 >> 22) % _config.TotalShards)) // then ellie server shard
|
||||
.Concat(Enumerable.Range(1, _config.TotalShards - 1)
|
||||
.OrderBy(_ => _rng.Next())) // then all other shards in a random order
|
||||
.Distinct()
|
||||
|
|
Loading…
Reference in a new issue