- Renamed Prefix to prefix

- Updated some command string keys which were using command name to use method names now
This commit is contained in:
Kwoth
2022-01-02 16:52:39 +01:00
parent 2edda76218
commit ca9fa1b0ac
18 changed files with 91 additions and 93 deletions

View File

@@ -50,7 +50,7 @@ public partial class Administration
await ReplyConfirmLocalizedAsync(strs.boostmsg_new);
if (!sendBoostEnabled)
await ReplyPendingLocalizedAsync(strs.boostmsg_enable($"`{Prefix}boost`"));
await ReplyPendingLocalizedAsync(strs.boostmsg_enable($"`{prefix}boost`"));
}
[Cmd]
@@ -99,7 +99,7 @@ public partial class Administration
await ReplyConfirmLocalizedAsync(strs.greetmsg_new);
if (!sendGreetEnabled)
await ReplyPendingLocalizedAsync(strs.greetmsg_enable($"`{Prefix}greet`"));
await ReplyPendingLocalizedAsync(strs.greetmsg_enable($"`{prefix}greet`"));
}
[Cmd]
@@ -131,7 +131,7 @@ public partial class Administration
await ReplyConfirmLocalizedAsync(strs.greetdmmsg_new);
if (!sendGreetEnabled)
await ReplyPendingLocalizedAsync(strs.greetdmmsg_enable($"`{Prefix}greetdm`"));
await ReplyPendingLocalizedAsync(strs.greetdmmsg_enable($"`{prefix}greetdm`"));
}
[Cmd]
@@ -163,7 +163,7 @@ public partial class Administration
await ReplyConfirmLocalizedAsync(strs.byemsg_new);
if (!sendByeEnabled)
await ReplyPendingLocalizedAsync(strs.byemsg_enable($"`{Prefix}bye`"));
await ReplyPendingLocalizedAsync(strs.byemsg_enable($"`{prefix}bye`"));
}
[Cmd]
@@ -190,7 +190,7 @@ public partial class Administration
await _service.ByeTest((ITextChannel)ctx.Channel, user);
var enabled = _service.GetByeEnabled(ctx.Guild.Id);
if (!enabled) await ReplyPendingLocalizedAsync(strs.byemsg_enable($"`{Prefix}bye`"));
if (!enabled) await ReplyPendingLocalizedAsync(strs.byemsg_enable($"`{prefix}bye`"));
}
[Cmd]
@@ -203,7 +203,7 @@ public partial class Administration
await _service.GreetTest((ITextChannel)ctx.Channel, user);
var enabled = _service.GetGreetEnabled(ctx.Guild.Id);
if (!enabled) await ReplyPendingLocalizedAsync(strs.greetmsg_enable($"`{Prefix}greet`"));
if (!enabled) await ReplyPendingLocalizedAsync(strs.greetmsg_enable($"`{prefix}greet`"));
}
[Cmd]
@@ -222,7 +222,7 @@ public partial class Administration
await ctx.WarningAsync();
var enabled = _service.GetGreetDmEnabled(ctx.Guild.Id);
if (!enabled)
await ReplyPendingLocalizedAsync(strs.greetdmmsg_enable($"`{Prefix}greetdm`"));
await ReplyPendingLocalizedAsync(strs.greetdmmsg_enable($"`{prefix}greetdm`"));
}
}
}

View File

@@ -13,26 +13,26 @@ public partial class Administration
[Cmd]
[Priority(1)]
public async partial Task PrefixCommand()
public async partial Task Prefix()
=> await ReplyConfirmLocalizedAsync(strs.prefix_current(Format.Code(CmdHandler.GetPrefix(ctx.Guild))));
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
[Priority(0)]
public partial Task PrefixCommand(Set _, [Leftover] string prefix)
=> PrefixCommand(prefix);
public partial Task Prefix(Set _, [Leftover] string prefix)
=> Prefix(prefix);
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
[Priority(0)]
public async partial Task PrefixCommand([Leftover] string prefix)
public async partial Task Prefix([Leftover] string prefix)
{
if (string.IsNullOrWhiteSpace(prefix))
return;
var oldPrefix = Prefix;
var oldPrefix = base.prefix;
var newPrefix = CmdHandler.SetPrefix(ctx.Guild, prefix);
await ReplyConfirmLocalizedAsync(strs.prefix_new(Format.Code(oldPrefix), Format.Code(newPrefix)));

View File

@@ -34,7 +34,7 @@ public partial class Administration
[OwnerOnly]
public async partial Task StartupCommandAdd([Leftover] string cmdText)
{
if (cmdText.StartsWith(Prefix + "die", StringComparison.InvariantCulture))
if (cmdText.StartsWith(prefix + "die", StringComparison.InvariantCulture))
return;
var guser = (IGuildUser)ctx.User;
@@ -67,7 +67,7 @@ public partial class Administration
[OwnerOnly]
public async partial Task AutoCommandAdd(int interval, [Leftover] string cmdText)
{
if (cmdText.StartsWith(Prefix + "die", StringComparison.InvariantCulture))
if (cmdText.StartsWith(prefix + "die", StringComparison.InvariantCulture))
return;
if (interval < 5)

View File

@@ -18,9 +18,9 @@ public partial class Administration
var newVal = _service.ToggleAdSarm(ctx.Guild.Id);
if (newVal)
await ReplyConfirmLocalizedAsync(strs.adsarm_enable(Prefix));
await ReplyConfirmLocalizedAsync(strs.adsarm_enable(prefix));
else
await ReplyConfirmLocalizedAsync(strs.adsarm_disable(Prefix));
await ReplyConfirmLocalizedAsync(strs.adsarm_disable(prefix));
}
[Cmd]