mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Restructured folders and project names, ci should be fixed
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using Discord.Commands;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using NadekoBot.Common.Attributes;
|
||||
using NadekoBot.Modules.Administration.Services;
|
||||
using Discord;
|
||||
|
||||
namespace NadekoBot.Modules.Administration
|
||||
{
|
||||
public partial class Administration
|
||||
{
|
||||
[Group]
|
||||
public class PlayingRotateCommands : NadekoSubmodule<PlayingRotateService>
|
||||
{
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[OwnerOnly]
|
||||
public async Task RotatePlaying()
|
||||
{
|
||||
if (_service.ToggleRotatePlaying())
|
||||
await ReplyConfirmLocalizedAsync("ropl_enabled").ConfigureAwait(false);
|
||||
else
|
||||
await ReplyConfirmLocalizedAsync("ropl_disabled").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[OwnerOnly]
|
||||
public async Task AddPlaying(ActivityType t, [Leftover] string status)
|
||||
{
|
||||
await _service.AddPlaying(t, status).ConfigureAwait(false);
|
||||
|
||||
await ReplyConfirmLocalizedAsync("ropl_added").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[OwnerOnly]
|
||||
public async Task ListPlaying()
|
||||
{
|
||||
var statuses = _service.GetRotatingStatuses();
|
||||
|
||||
if (!statuses.Any())
|
||||
{
|
||||
await ReplyErrorLocalizedAsync("ropl_not_set").ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
var i = 1;
|
||||
await ReplyConfirmLocalizedAsync("ropl_list",
|
||||
string.Join("\n\t", statuses.Select(rs => $"`{i++}.` *{rs.Type}* {rs.Status}")))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[OwnerOnly]
|
||||
public async Task RemovePlaying(int index)
|
||||
{
|
||||
index -= 1;
|
||||
|
||||
var msg = await _service.RemovePlayingAsync(index).ConfigureAwait(false);
|
||||
|
||||
if (msg == null)
|
||||
return;
|
||||
|
||||
await ReplyConfirmLocalizedAsync("reprm", msg).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user