mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
More cleanup, namespace fixes, convenience methods for IKernel
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
#nullable enable
|
||||
|
||||
using Nadeko.Snake;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Services;
|
||||
|
||||
[DIIgnore]
|
||||
public sealed class BehaviorAdapter : ICustomBehavior
|
||||
{
|
||||
@@ -12,6 +8,8 @@ public sealed class BehaviorAdapter : ICustomBehavior
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly string _name;
|
||||
|
||||
public string Name => _name;
|
||||
|
||||
// unused
|
||||
public int Priority
|
||||
=> 0;
|
||||
@@ -53,7 +51,7 @@ public sealed class BehaviorAdapter : ICustomBehavior
|
||||
{
|
||||
if (!_snekWr.TryGetTarget(out var snek))
|
||||
return null;
|
||||
|
||||
|
||||
return await snek.ExecInputTransformAsync(guild, channel, user, input);
|
||||
}
|
||||
|
||||
@@ -69,7 +67,7 @@ public sealed class BehaviorAdapter : ICustomBehavior
|
||||
{
|
||||
if (!_snekWr.TryGetTarget(out var snek))
|
||||
return;
|
||||
|
||||
|
||||
await snek.ExecPostCommandAsync(ContextAdapterFactory.CreateNew(context, _strings, _services),
|
||||
moduleName,
|
||||
commandName);
|
||||
|
Reference in New Issue
Block a user