mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Added .repeatskip
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user