Added .repeatskip

This commit is contained in:
Kwoth
2022-07-26 16:56:33 +02:00
parent 0f8291c589
commit e20212a6cb
6 changed files with 66 additions and 4 deletions

View File

@@ -9,6 +9,32 @@ public partial class Utility
[Group]
public partial class RepeatCommands : NadekoModule<RepeaterService>
{
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.ManageMessages)]
public async Task RepeatSkip(int index)
{
if (--index < 0)
return;
var result = await _service.ToggleSkipNextAsync(ctx.Guild.Id, index);
if (result is null)
{
await ReplyErrorLocalizedAsync(strs.index_out_of_range);
return;
}
if (result is true)
{
await ReplyConfirmLocalizedAsync(strs.repeater_skip_next);
}
else
{
await ReplyConfirmLocalizedAsync(strs.repeater_dont_skip_next);
}
}
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.ManageMessages)]
@@ -149,7 +175,7 @@ public partial class Utility
foreach (var runner in repeaters.OrderBy(r => r.Repeater.Id))
{
var description = GetRepeaterInfoString(runner);
var name = $"#`{++i}`";
var name = $"#`{++i}` {(_service.IsRepeaterSkipped(runner.Repeater.Id) ? "🦘" : "")}";
embed.AddField(name, description);
}