mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 10:18:27 -04:00
Applied codestyle to all .cs files
This commit is contained in:
@@ -9,4 +9,4 @@ public sealed class AliasesAttribute : AliasAttribute
|
||||
: base(CommandNameLoadHelper.GetAliasesFor(memberName))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,9 +1,10 @@
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace NadekoBot.Common.Attributes;
|
||||
|
||||
public static class CommandNameLoadHelper
|
||||
{
|
||||
private static readonly YamlDotNet.Serialization.IDeserializer _deserializer =
|
||||
new YamlDotNet.Serialization.Deserializer();
|
||||
private static readonly IDeserializer _deserializer = new Deserializer();
|
||||
|
||||
public static Lazy<Dictionary<string, string[]>> LazyCommandAliases = new(() => LoadCommandNames());
|
||||
|
||||
@@ -26,4 +27,4 @@ public static class CommandNameLoadHelper
|
||||
: methodName;
|
||||
return toReturn;
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,9 +5,9 @@ namespace NadekoBot.Common.Attributes;
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public sealed class NadekoCommandAttribute : CommandAttribute
|
||||
{
|
||||
public string MethodName { get; }
|
||||
|
||||
public NadekoCommandAttribute([CallerMemberName] string memberName = "")
|
||||
: base(CommandNameLoadHelper.GetCommandNameFor(memberName))
|
||||
=> this.MethodName = memberName.ToLowerInvariant();
|
||||
|
||||
public string MethodName { get; }
|
||||
}
|
||||
=> MethodName = memberName.ToLowerInvariant();
|
||||
}
|
@@ -7,4 +7,4 @@ internal sealed class NadekoModuleAttribute : GroupAttribute
|
||||
: base(moduleName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,5 +6,5 @@ public sealed class NadekoOptionsAttribute : Attribute
|
||||
public Type OptionType { get; set; }
|
||||
|
||||
public NadekoOptionsAttribute(Type t)
|
||||
=> this.OptionType = t;
|
||||
}
|
||||
=> OptionType = t;
|
||||
}
|
@@ -14,7 +14,6 @@ public sealed class OwnerOnlyAttribute : PreconditionAttribute
|
||||
|
||||
return Task.FromResult(creds.IsOwner(context.User) || context.Client.CurrentUser.Id == context.User.Id
|
||||
? PreconditionResult.FromSuccess()
|
||||
: PreconditionResult.FromError("Not owner")
|
||||
);
|
||||
: PreconditionResult.FromError("Not owner"));
|
||||
}
|
||||
}
|
||||
}
|
@@ -33,4 +33,4 @@ public sealed class RatelimitAttribute : PreconditionAttribute
|
||||
|
||||
return Task.FromResult(PreconditionResult.FromError(msgContent));
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,6 +6,16 @@ namespace Discord;
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class UserPermAttribute : RequireUserPermissionAttribute
|
||||
{
|
||||
public UserPermAttribute(GuildPerm permission)
|
||||
: base(permission)
|
||||
{
|
||||
}
|
||||
|
||||
public UserPermAttribute(ChannelPerm permission)
|
||||
: base(permission)
|
||||
{
|
||||
}
|
||||
|
||||
public override Task<PreconditionResult> CheckPermissionsAsync(
|
||||
ICommandContext context,
|
||||
CommandInfo command,
|
||||
@@ -17,14 +27,4 @@ public class UserPermAttribute : RequireUserPermissionAttribute
|
||||
|
||||
return base.CheckPermissionsAsync(context, command, services);
|
||||
}
|
||||
|
||||
public UserPermAttribute(GuildPerm permission)
|
||||
: base(permission)
|
||||
{
|
||||
}
|
||||
|
||||
public UserPermAttribute(ChannelPerm permission)
|
||||
: base(permission)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user