mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Removed cmd source generator. Commands are no longer partial methods. Compilations should be slightly faster now. Updated packages and adapted drawing code to the new apis. There may be some bugs.
This commit is contained in:
@@ -41,7 +41,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[BotPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task ImageOnlyChannel(StoopidTime time = null)
|
||||
public async Task ImageOnlyChannel(StoopidTime time = null)
|
||||
{
|
||||
var newValue = _imageOnly.ToggleImageOnlyChannel(ctx.Guild.Id, ctx.Channel.Id);
|
||||
if (newValue)
|
||||
@@ -54,7 +54,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(ChannelPerm.ManageChannels)]
|
||||
[BotPerm(ChannelPerm.ManageChannels)]
|
||||
public async partial Task Slowmode(StoopidTime time = null)
|
||||
public async Task Slowmode(StoopidTime time = null)
|
||||
{
|
||||
var seconds = (int?)time?.Time.TotalSeconds ?? 0;
|
||||
if (time is not null && (time.Time < TimeSpan.FromSeconds(0) || time.Time > TimeSpan.FromHours(6)))
|
||||
@@ -73,7 +73,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[BotPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(2)]
|
||||
public async partial Task Delmsgoncmd(List _)
|
||||
public async Task Delmsgoncmd(List _)
|
||||
{
|
||||
var guild = (SocketGuild)ctx.Guild;
|
||||
var (enabled, channels) = _service.GetDelMsgOnCmdData(ctx.Guild.Id);
|
||||
@@ -104,7 +104,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[BotPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(1)]
|
||||
public async partial Task Delmsgoncmd(Server _ = Server.Server)
|
||||
public async Task Delmsgoncmd(Server _ = Server.Server)
|
||||
{
|
||||
if (_service.ToggleDeleteMessageOnCommand(ctx.Guild.Id))
|
||||
{
|
||||
@@ -123,7 +123,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[BotPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public partial Task Delmsgoncmd(Channel _, State s, ITextChannel ch)
|
||||
public Task Delmsgoncmd(Channel _, State s, ITextChannel ch)
|
||||
=> Delmsgoncmd(_, s, ch.Id);
|
||||
|
||||
[Cmd]
|
||||
@@ -131,7 +131,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[BotPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(1)]
|
||||
public async partial Task Delmsgoncmd(Channel _, State s, ulong? chId = null)
|
||||
public async Task Delmsgoncmd(Channel _, State s, ulong? chId = null)
|
||||
{
|
||||
var actualChId = chId ?? ctx.Channel.Id;
|
||||
await _service.SetDelMsgOnCmdState(ctx.Guild.Id, actualChId, s);
|
||||
@@ -148,7 +148,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.DeafenMembers)]
|
||||
[BotPerm(GuildPerm.DeafenMembers)]
|
||||
public async partial Task Deafen(params IGuildUser[] users)
|
||||
public async Task Deafen(params IGuildUser[] users)
|
||||
{
|
||||
await _service.DeafenUsers(true, users);
|
||||
await ReplyConfirmLocalizedAsync(strs.deafen);
|
||||
@@ -158,7 +158,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.DeafenMembers)]
|
||||
[BotPerm(GuildPerm.DeafenMembers)]
|
||||
public async partial Task UnDeafen(params IGuildUser[] users)
|
||||
public async Task UnDeafen(params IGuildUser[] users)
|
||||
{
|
||||
await _service.DeafenUsers(false, users);
|
||||
await ReplyConfirmLocalizedAsync(strs.undeafen);
|
||||
@@ -168,7 +168,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task DelVoiChanl([Leftover] IVoiceChannel voiceChannel)
|
||||
public async Task DelVoiChanl([Leftover] IVoiceChannel voiceChannel)
|
||||
{
|
||||
await voiceChannel.DeleteAsync();
|
||||
await ReplyConfirmLocalizedAsync(strs.delvoich(Format.Bold(voiceChannel.Name)));
|
||||
@@ -178,7 +178,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task CreatVoiChanl([Leftover] string channelName)
|
||||
public async Task CreatVoiChanl([Leftover] string channelName)
|
||||
{
|
||||
var ch = await ctx.Guild.CreateVoiceChannelAsync(channelName);
|
||||
await ReplyConfirmLocalizedAsync(strs.createvoich(Format.Bold(ch.Name)));
|
||||
@@ -188,7 +188,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task DelTxtChanl([Leftover] ITextChannel toDelete)
|
||||
public async Task DelTxtChanl([Leftover] ITextChannel toDelete)
|
||||
{
|
||||
await toDelete.DeleteAsync();
|
||||
await ReplyConfirmLocalizedAsync(strs.deltextchan(Format.Bold(toDelete.Name)));
|
||||
@@ -198,9 +198,9 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task CreaTxtChanl([Leftover] string channelName)
|
||||
public async Task CreaTxtChanl([Leftover] string channelName)
|
||||
{
|
||||
var txtCh = await ctx.Guild.CreateTextChannelAsync(channelName);
|
||||
var txtCh = await ctx.Guild.CreateTextChannelAsync(channelName);
|
||||
await ReplyConfirmLocalizedAsync(strs.createtextchan(Format.Bold(txtCh.Name)));
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task SetTopic([Leftover] string topic = null)
|
||||
public async Task SetTopic([Leftover] string topic = null)
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
topic ??= "";
|
||||
@@ -220,7 +220,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task SetChanlName([Leftover] string name)
|
||||
public async Task SetChanlName([Leftover] string name)
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
await channel.ModifyAsync(c => c.Name = name);
|
||||
@@ -231,7 +231,7 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageChannels)]
|
||||
[BotPerm(GuildPerm.ManageChannels)]
|
||||
public async partial Task NsfwToggle()
|
||||
public async Task NsfwToggle()
|
||||
{
|
||||
var channel = (ITextChannel)ctx.Channel;
|
||||
var isEnabled = channel.IsNsfw;
|
||||
@@ -248,13 +248,13 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(ChannelPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public partial Task Edit(ulong messageId, [Leftover] string text)
|
||||
public Task Edit(ulong messageId, [Leftover] string text)
|
||||
=> Edit((ITextChannel)ctx.Channel, messageId, text);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(1)]
|
||||
public async partial Task Edit(ITextChannel channel, ulong messageId, [Leftover] string text)
|
||||
public async Task Edit(ITextChannel channel, ulong messageId, [Leftover] string text)
|
||||
{
|
||||
var userPerms = ((SocketGuildUser)ctx.User).GetPermissions(channel);
|
||||
var botPerms = ((SocketGuild)ctx.Guild).CurrentUser.GetPermissions(channel);
|
||||
@@ -277,12 +277,12 @@ public partial class Administration : NadekoModule<AdministrationService>
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(ChannelPerm.ManageMessages)]
|
||||
[BotPerm(ChannelPerm.ManageMessages)]
|
||||
public partial Task Delete(ulong messageId, StoopidTime time = null)
|
||||
public Task Delete(ulong messageId, StoopidTime time = null)
|
||||
=> Delete((ITextChannel)ctx.Channel, messageId, time);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Delete(ITextChannel channel, ulong messageId, StoopidTime time = null)
|
||||
public async Task Delete(ITextChannel channel, ulong messageId, StoopidTime time = null)
|
||||
=> await InternalMessageAction(channel, messageId, time, msg => msg.DeleteAsync());
|
||||
|
||||
private async Task InternalMessageAction(
|
||||
|
@@ -42,11 +42,11 @@ public class AdministrationService : INService
|
||||
|
||||
private Task DelMsgOnCmd_Handler(IUserMessage msg, CommandInfo cmd)
|
||||
{
|
||||
if (msg.Channel is not ITextChannel channel)
|
||||
return Task.CompletedTask;
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
if (msg.Channel is not SocketTextChannel channel)
|
||||
return;
|
||||
|
||||
//wat ?!
|
||||
if (DeleteMessagesOnCommandChannels.TryGetValue(channel.Id, out var state))
|
||||
{
|
||||
|
@@ -13,7 +13,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task AutoAssignRole([Leftover] IRole role)
|
||||
public async Task AutoAssignRole([Leftover] IRole role)
|
||||
{
|
||||
var guser = (IGuildUser)ctx.User;
|
||||
if (role.Id == ctx.Guild.EveryoneRole.Id)
|
||||
@@ -39,7 +39,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task AutoAssignRole()
|
||||
public async Task AutoAssignRole()
|
||||
{
|
||||
if (!_service.TryGetRoles(ctx.Guild.Id, out var roles))
|
||||
{
|
||||
|
@@ -32,7 +32,7 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task SqlSelect([Leftover] string sql)
|
||||
public Task SqlSelect([Leftover] string sql)
|
||||
{
|
||||
var result = _service.SelectSql(sql);
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task SqlExec([Leftover] string sql)
|
||||
public async Task SqlExec([Leftover] string sql)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -78,37 +78,37 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task DeleteWaifus()
|
||||
public Task DeleteWaifus()
|
||||
=> ConfirmActionInternalAsync("Delete Waifus", () => _service.DeleteWaifus());
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task DeleteWaifu(IUser user)
|
||||
public async Task DeleteWaifu(IUser user)
|
||||
=> await DeleteWaifu(user.Id);
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task DeleteWaifu(ulong userId)
|
||||
public Task DeleteWaifu(ulong userId)
|
||||
=> ConfirmActionInternalAsync($"Delete Waifu {userId}", () => _service.DeleteWaifu(userId));
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task DeleteCurrency()
|
||||
public Task DeleteCurrency()
|
||||
=> ConfirmActionInternalAsync("Delete Currency", () => _service.DeleteCurrency());
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task DeletePlaylists()
|
||||
public Task DeletePlaylists()
|
||||
=> ConfirmActionInternalAsync("Delete Playlists", () => _service.DeletePlaylists());
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task DeleteXp()
|
||||
public Task DeleteXp()
|
||||
=> ConfirmActionInternalAsync("Delete Xp", () => _service.DeleteXp());
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task PurgeUser(ulong userId)
|
||||
public async Task PurgeUser(ulong userId)
|
||||
{
|
||||
var embed = _eb.Create()
|
||||
.WithDescription(GetText(strs.purge_user_confirm(Format.Bold(userId.ToString()))));
|
||||
@@ -122,7 +122,7 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task PurgeUser([Leftover] IUser user)
|
||||
public Task PurgeUser([Leftover] IUser user)
|
||||
=> PurgeUser(user.Id);
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[BotPerm(GuildPerm.MoveMembers)]
|
||||
public async partial Task GameVoiceChannel()
|
||||
public async Task GameVoiceChannel()
|
||||
{
|
||||
var vch = ((IGuildUser)ctx.User).VoiceChannel;
|
||||
|
||||
|
@@ -8,7 +8,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task Boost()
|
||||
public async Task Boost()
|
||||
{
|
||||
var enabled = await _service.ToggleBoost(ctx.Guild.Id, ctx.Channel.Id);
|
||||
|
||||
@@ -21,7 +21,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task BoostDel(int timer = 30)
|
||||
public async Task BoostDel(int timer = 30)
|
||||
{
|
||||
if (timer is < 0 or > 600)
|
||||
return;
|
||||
@@ -37,7 +37,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task BoostMsg([Leftover] string? text = null)
|
||||
public async Task BoostMsg([Leftover] string? text = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task GreetDel(int timer = 30)
|
||||
public async Task GreetDel(int timer = 30)
|
||||
{
|
||||
if (timer is < 0 or > 600)
|
||||
return;
|
||||
@@ -72,7 +72,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task Greet()
|
||||
public async Task Greet()
|
||||
{
|
||||
var enabled = await _service.SetGreet(ctx.Guild.Id, ctx.Channel.Id);
|
||||
|
||||
@@ -85,7 +85,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task GreetMsg([Leftover] string? text = null)
|
||||
public async Task GreetMsg([Leftover] string? text = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
@@ -105,7 +105,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task GreetDm()
|
||||
public async Task GreetDm()
|
||||
{
|
||||
var enabled = await _service.SetGreetDm(ctx.Guild.Id);
|
||||
|
||||
@@ -118,7 +118,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task GreetDmMsg([Leftover] string? text = null)
|
||||
public async Task GreetDmMsg([Leftover] string? text = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
@@ -137,7 +137,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task Bye()
|
||||
public async Task Bye()
|
||||
{
|
||||
var enabled = await _service.SetBye(ctx.Guild.Id, ctx.Channel.Id);
|
||||
|
||||
@@ -150,7 +150,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task ByeMsg([Leftover] string? text = null)
|
||||
public async Task ByeMsg([Leftover] string? text = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
@@ -169,7 +169,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
public async partial Task ByeDel(int timer = 30)
|
||||
public async Task ByeDel(int timer = 30)
|
||||
{
|
||||
await _service.SetByeDel(ctx.Guild.Id, timer);
|
||||
|
||||
@@ -184,7 +184,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
[Ratelimit(5)]
|
||||
public async partial Task ByeTest([Leftover] IGuildUser? user = null)
|
||||
public async Task ByeTest([Leftover] IGuildUser? user = null)
|
||||
{
|
||||
user ??= (IGuildUser)ctx.User;
|
||||
|
||||
@@ -198,7 +198,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
[Ratelimit(5)]
|
||||
public async partial Task GreetTest([Leftover] IGuildUser? user = null)
|
||||
public async Task GreetTest([Leftover] IGuildUser? user = null)
|
||||
{
|
||||
user ??= (IGuildUser)ctx.User;
|
||||
|
||||
@@ -212,7 +212,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageGuild)]
|
||||
[Ratelimit(5)]
|
||||
public async partial Task GreetDmTest([Leftover] IGuildUser? user = null)
|
||||
public async Task GreetDmTest([Leftover] IGuildUser? user = null)
|
||||
{
|
||||
user ??= (IGuildUser)ctx.User;
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(0)]
|
||||
public async partial Task LanguageSet()
|
||||
public async Task LanguageSet()
|
||||
=> await ReplyConfirmLocalizedAsync(strs.lang_set_show(Format.Bold(Culture.ToString()),
|
||||
Format.Bold(Culture.NativeName)));
|
||||
|
||||
@@ -49,7 +49,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(1)]
|
||||
public async partial Task LanguageSet(string name)
|
||||
public async Task LanguageSet(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public partial class Administration
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task LanguageSetDefault()
|
||||
public async Task LanguageSetDefault()
|
||||
{
|
||||
var cul = _localization.DefaultCultureInfo;
|
||||
await ReplyErrorLocalizedAsync(strs.lang_set_bot_show(cul, cul.NativeName));
|
||||
@@ -82,7 +82,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task LanguageSetDefault(string name)
|
||||
public async Task LanguageSetDefault(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -108,7 +108,7 @@ public partial class Administration
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task LanguagesList()
|
||||
public async Task LanguagesList()
|
||||
=> await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.lang_list))
|
||||
|
@@ -26,7 +26,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task MuteRole([Leftover] IRole role = null)
|
||||
public async Task MuteRole([Leftover] IRole role = null)
|
||||
{
|
||||
if (role is null)
|
||||
{
|
||||
@@ -51,7 +51,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles | GuildPerm.MuteMembers)]
|
||||
[Priority(0)]
|
||||
public async partial Task Mute(IGuildUser target, [Leftover] string reason = "")
|
||||
public async Task Mute(IGuildUser target, [Leftover] string reason = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles | GuildPerm.MuteMembers)]
|
||||
[Priority(1)]
|
||||
public async partial Task Mute(StoopidTime time, IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task Mute(StoopidTime time, IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
if (time.Time < TimeSpan.FromMinutes(1) || time.Time > TimeSpan.FromDays(49))
|
||||
return;
|
||||
@@ -95,7 +95,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles | GuildPerm.MuteMembers)]
|
||||
public async partial Task Unmute(IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task Unmute(IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -112,7 +112,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[Priority(0)]
|
||||
public async partial Task ChatMute(IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task ChatMute(IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[Priority(1)]
|
||||
public async partial Task ChatMute(StoopidTime time, IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task ChatMute(StoopidTime time, IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
if (time.Time < TimeSpan.FromMinutes(1) || time.Time > TimeSpan.FromDays(49))
|
||||
return;
|
||||
@@ -156,7 +156,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task ChatUnmute(IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task ChatUnmute(IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -173,7 +173,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.MuteMembers)]
|
||||
[Priority(0)]
|
||||
public async partial Task VoiceMute(IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task VoiceMute(IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -193,7 +193,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.MuteMembers)]
|
||||
[Priority(1)]
|
||||
public async partial Task VoiceMute(StoopidTime time, IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task VoiceMute(StoopidTime time, IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
if (time.Time < TimeSpan.FromMinutes(1) || time.Time > TimeSpan.FromDays(49))
|
||||
return;
|
||||
@@ -215,7 +215,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.MuteMembers)]
|
||||
public async partial Task VoiceUnmute(IGuildUser user, [Leftover] string reason = "")
|
||||
public async Task VoiceUnmute(IGuildUser user, [Leftover] string reason = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -15,7 +15,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task DiscordPermOverride(CommandOrExprInfo cmd, params GuildPerm[] perms)
|
||||
public async Task DiscordPermOverride(CommandOrExprInfo cmd, params GuildPerm[] perms)
|
||||
{
|
||||
if (perms is null || perms.Length == 0)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task DiscordPermOverrideReset()
|
||||
public async Task DiscordPermOverrideReset()
|
||||
{
|
||||
var result = await PromptUserConfirmAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
@@ -51,7 +51,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task DiscordPermOverrideList(int page = 1)
|
||||
public async Task DiscordPermOverrideList(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return;
|
||||
|
@@ -10,7 +10,7 @@ public partial class Administration
|
||||
{
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task RotatePlaying()
|
||||
public async Task RotatePlaying()
|
||||
{
|
||||
if (_service.ToggleRotatePlaying())
|
||||
await ReplyConfirmLocalizedAsync(strs.ropl_enabled);
|
||||
@@ -20,7 +20,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task AddPlaying(ActivityType t, [Leftover] string status)
|
||||
public async Task AddPlaying(ActivityType t, [Leftover] string status)
|
||||
{
|
||||
await _service.AddPlaying(t, status);
|
||||
|
||||
@@ -29,7 +29,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task ListPlaying()
|
||||
public async Task ListPlaying()
|
||||
{
|
||||
var statuses = _service.GetRotatingStatuses();
|
||||
|
||||
@@ -45,7 +45,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task RemovePlaying(int index)
|
||||
public async Task RemovePlaying(int index)
|
||||
{
|
||||
index -= 1;
|
||||
|
||||
|
@@ -13,21 +13,21 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[Priority(1)]
|
||||
public async partial Task Prefix()
|
||||
public async 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 Prefix(Set _, [Leftover] string newPrefix)
|
||||
public Task Prefix(Set _, [Leftover] string newPrefix)
|
||||
=> Prefix(newPrefix);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(0)]
|
||||
public async partial Task Prefix([Leftover] string toSet)
|
||||
public async Task Prefix([Leftover] string toSet)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(prefix))
|
||||
return;
|
||||
@@ -40,7 +40,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task DefPrefix([Leftover] string toSet = null)
|
||||
public async Task DefPrefix([Leftover] string toSet = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(toSet))
|
||||
{
|
||||
|
@@ -13,7 +13,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task AntiAlt()
|
||||
public async Task AntiAlt()
|
||||
{
|
||||
if (await _service.TryStopAntiAlt(ctx.Guild.Id))
|
||||
{
|
||||
@@ -27,7 +27,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task AntiAlt(
|
||||
public async Task AntiAlt(
|
||||
StoopidTime minAge,
|
||||
PunishmentAction action,
|
||||
[Leftover] StoopidTime punishTime = null)
|
||||
@@ -49,7 +49,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task AntiAlt(StoopidTime minAge, PunishmentAction action, [Leftover] IRole role)
|
||||
public async Task AntiAlt(StoopidTime minAge, PunishmentAction action, [Leftover] IRole role)
|
||||
{
|
||||
var minAgeMinutes = (int)minAge.Time.TotalMinutes;
|
||||
|
||||
@@ -64,7 +64,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public partial Task AntiRaid()
|
||||
public Task AntiRaid()
|
||||
{
|
||||
if (_service.TryStopAntiRaid(ctx.Guild.Id))
|
||||
return ReplyConfirmLocalizedAsync(strs.prot_disable("Anti-Raid"));
|
||||
@@ -75,7 +75,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(1)]
|
||||
public partial Task AntiRaid(
|
||||
public Task AntiRaid(
|
||||
int userThreshold,
|
||||
int seconds,
|
||||
PunishmentAction action,
|
||||
@@ -86,7 +86,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(2)]
|
||||
public partial Task AntiRaid(int userThreshold, int seconds, PunishmentAction action)
|
||||
public Task AntiRaid(int userThreshold, int seconds, PunishmentAction action)
|
||||
=> InternalAntiRaid(userThreshold, seconds, action);
|
||||
|
||||
private async Task InternalAntiRaid(
|
||||
@@ -135,7 +135,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public partial Task AntiSpam()
|
||||
public Task AntiSpam()
|
||||
{
|
||||
if (_service.TryStopAntiSpam(ctx.Guild.Id))
|
||||
return ReplyConfirmLocalizedAsync(strs.prot_disable("Anti-Spam"));
|
||||
@@ -146,7 +146,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(0)]
|
||||
public partial Task AntiSpam(int messageCount, PunishmentAction action, [Leftover] IRole role)
|
||||
public Task AntiSpam(int messageCount, PunishmentAction action, [Leftover] IRole role)
|
||||
{
|
||||
if (action != PunishmentAction.AddRole)
|
||||
return Task.CompletedTask;
|
||||
@@ -158,14 +158,14 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(1)]
|
||||
public partial Task AntiSpam(int messageCount, PunishmentAction action, [Leftover] StoopidTime punishTime)
|
||||
public Task AntiSpam(int messageCount, PunishmentAction action, [Leftover] StoopidTime punishTime)
|
||||
=> InternalAntiSpam(messageCount, action, punishTime);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(2)]
|
||||
public partial Task AntiSpam(int messageCount, PunishmentAction action)
|
||||
public Task AntiSpam(int messageCount, PunishmentAction action)
|
||||
=> InternalAntiSpam(messageCount, action);
|
||||
|
||||
private async Task InternalAntiSpam(
|
||||
@@ -196,7 +196,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task AntispamIgnore()
|
||||
public async Task AntispamIgnore()
|
||||
{
|
||||
var added = await _service.AntiSpamIgnoreAsync(ctx.Guild.Id, ctx.Channel.Id);
|
||||
|
||||
@@ -214,7 +214,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task AntiList()
|
||||
public async Task AntiList()
|
||||
{
|
||||
var (spam, raid, alt) = _service.GetAntiStats(ctx.Guild.Id);
|
||||
|
||||
|
@@ -13,7 +13,7 @@ public partial class Administration
|
||||
//delets her own messages, no perm required
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Prune(string parameter = null)
|
||||
public async Task Prune(string parameter = null)
|
||||
{
|
||||
var user = await ctx.Guild.GetCurrentUserAsync();
|
||||
|
||||
@@ -30,7 +30,7 @@ public partial class Administration
|
||||
[UserPerm(ChannelPerm.ManageMessages)]
|
||||
[BotPerm(ChannelPerm.ManageMessages)]
|
||||
[Priority(1)]
|
||||
public async partial Task Prune(int count, string parameter = null)
|
||||
public async Task Prune(int count, string parameter = null)
|
||||
{
|
||||
count++;
|
||||
if (count < 1)
|
||||
@@ -50,7 +50,7 @@ public partial class Administration
|
||||
[UserPerm(ChannelPerm.ManageMessages)]
|
||||
[BotPerm(ChannelPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public partial Task Prune(IGuildUser user, int count = 100, string parameter = null)
|
||||
public Task Prune(IGuildUser user, int count = 100, string parameter = null)
|
||||
=> Prune(user.Id, count, parameter);
|
||||
|
||||
//prune userid [x]
|
||||
@@ -59,7 +59,7 @@ public partial class Administration
|
||||
[UserPerm(ChannelPerm.ManageMessages)]
|
||||
[BotPerm(ChannelPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public async partial Task Prune(ulong userId, int count = 100, string parameter = null)
|
||||
public async Task Prune(ulong userId, int count = 100, string parameter = null)
|
||||
{
|
||||
if (userId == ctx.User.Id)
|
||||
count++;
|
||||
|
@@ -17,7 +17,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task ReactionRoleAdd(
|
||||
public async Task ReactionRoleAdd(
|
||||
ulong messageId,
|
||||
string emoteStr,
|
||||
IRole role,
|
||||
@@ -67,7 +67,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task ReactionRolesList()
|
||||
public async Task ReactionRolesList()
|
||||
{
|
||||
var reros = await _rero.GetReactionRolesAsync(ctx.Guild.Id);
|
||||
|
||||
@@ -109,7 +109,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task ReactionRolesRemove(ulong messageId)
|
||||
public async Task ReactionRolesRemove(ulong messageId)
|
||||
{
|
||||
var succ = await _rero.RemoveReactionRoles(ctx.Guild.Id, messageId);
|
||||
if (succ)
|
||||
@@ -122,7 +122,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task ReactionRolesDeleteAll()
|
||||
public async Task ReactionRolesDeleteAll()
|
||||
{
|
||||
await _rero.RemoveAllReactionRoles(ctx.Guild.Id);
|
||||
await ctx.OkAsync();
|
||||
@@ -133,7 +133,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[Ratelimit(60)]
|
||||
public async partial Task ReactionRolesTransfer(ulong fromMessageId, ulong toMessageId)
|
||||
public async Task ReactionRolesTransfer(ulong fromMessageId, ulong toMessageId)
|
||||
{
|
||||
var msg = await ctx.Channel.GetMessageAsync(toMessageId);
|
||||
|
||||
|
@@ -25,7 +25,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task SetRole(IGuildUser targetUser, [Leftover] IRole roleToAdd)
|
||||
public async Task SetRole(IGuildUser targetUser, [Leftover] IRole roleToAdd)
|
||||
{
|
||||
var runnerUser = (IGuildUser)ctx.User;
|
||||
var runnerMaxRolePosition = runnerUser.GetRoles().Max(x => x.Position);
|
||||
@@ -49,7 +49,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task RemoveRole(IGuildUser targetUser, [Leftover] IRole roleToRemove)
|
||||
public async Task RemoveRole(IGuildUser targetUser, [Leftover] IRole roleToRemove)
|
||||
{
|
||||
var runnerUser = (IGuildUser)ctx.User;
|
||||
if (ctx.User.Id != runnerUser.Guild.OwnerId
|
||||
@@ -71,7 +71,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task RenameRole(IRole roleToEdit, [Leftover] string newname)
|
||||
public async Task RenameRole(IRole roleToEdit, [Leftover] string newname)
|
||||
{
|
||||
var guser = (IGuildUser)ctx.User;
|
||||
if (ctx.User.Id != guser.Guild.OwnerId && guser.GetRoles().Max(x => x.Position) <= roleToEdit.Position)
|
||||
@@ -97,7 +97,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task RemoveAllRoles([Leftover] IGuildUser user)
|
||||
public async Task RemoveAllRoles([Leftover] IGuildUser user)
|
||||
{
|
||||
var guser = (IGuildUser)ctx.User;
|
||||
|
||||
@@ -122,7 +122,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task CreateRole([Leftover] string roleName = null)
|
||||
public async Task CreateRole([Leftover] string roleName = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(roleName))
|
||||
return;
|
||||
@@ -135,7 +135,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task DeleteRole([Leftover] IRole role)
|
||||
public async Task DeleteRole([Leftover] IRole role)
|
||||
{
|
||||
var guser = (IGuildUser)ctx.User;
|
||||
if (ctx.User.Id != guser.Guild.OwnerId && guser.GetRoles().Max(x => x.Position) <= role.Position)
|
||||
@@ -149,7 +149,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task RoleHoist([Leftover] IRole role)
|
||||
public async Task RoleHoist([Leftover] IRole role)
|
||||
{
|
||||
var newHoisted = !role.IsHoisted;
|
||||
await role.ModifyAsync(r => r.Hoist = newHoisted);
|
||||
@@ -162,7 +162,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(1)]
|
||||
public async partial Task RoleColor([Leftover] IRole role)
|
||||
public async Task RoleColor([Leftover] IRole role)
|
||||
=> await SendConfirmAsync("Role Color", role.Color.RawValue.ToString("x6"));
|
||||
|
||||
[Cmd]
|
||||
@@ -170,7 +170,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[Priority(0)]
|
||||
public async partial Task RoleColor(Color color, [Leftover] IRole role)
|
||||
public async Task RoleColor(Color color, [Leftover] IRole role)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task StartupCommandAdd([Leftover] string cmdText)
|
||||
public async Task StartupCommandAdd([Leftover] string cmdText)
|
||||
{
|
||||
if (cmdText.StartsWith(prefix + "die", StringComparison.InvariantCulture))
|
||||
return;
|
||||
@@ -72,7 +72,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task AutoCommandAdd(int interval, [Leftover] string cmdText)
|
||||
public async Task AutoCommandAdd(int interval, [Leftover] string cmdText)
|
||||
{
|
||||
if (cmdText.StartsWith(prefix + "die", StringComparison.InvariantCulture))
|
||||
return;
|
||||
@@ -100,7 +100,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[OwnerOnly]
|
||||
public async partial Task StartupCommandsList(int page = 1)
|
||||
public async Task StartupCommandsList(int page = 1)
|
||||
{
|
||||
if (page-- < 1)
|
||||
return;
|
||||
@@ -126,7 +126,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[OwnerOnly]
|
||||
public async partial Task AutoCommandsList(int page = 1)
|
||||
public async Task AutoCommandsList(int page = 1)
|
||||
{
|
||||
if (page-- < 1)
|
||||
return;
|
||||
@@ -154,7 +154,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task Wait(int miliseconds)
|
||||
public async Task Wait(int miliseconds)
|
||||
{
|
||||
if (miliseconds <= 0)
|
||||
return;
|
||||
@@ -173,7 +173,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task AutoCommandRemove([Leftover] int index)
|
||||
public async Task AutoCommandRemove([Leftover] int index)
|
||||
{
|
||||
if (!_service.RemoveAutoCommand(--index, out _))
|
||||
{
|
||||
@@ -187,7 +187,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[OwnerOnly]
|
||||
public async partial Task StartupCommandRemove([Leftover] int index)
|
||||
public async Task StartupCommandRemove([Leftover] int index)
|
||||
{
|
||||
if (!_service.RemoveStartupCommand(--index, out _))
|
||||
await ReplyErrorLocalizedAsync(strs.scrm_fail);
|
||||
@@ -199,7 +199,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task StartupCommandsClear()
|
||||
public async Task StartupCommandsClear()
|
||||
{
|
||||
_service.ClearStartupCommands();
|
||||
|
||||
@@ -208,7 +208,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task ForwardMessages()
|
||||
public async Task ForwardMessages()
|
||||
{
|
||||
var enabled = _service.ForwardMessages();
|
||||
|
||||
@@ -220,7 +220,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task ForwardToAll()
|
||||
public async Task ForwardToAll()
|
||||
{
|
||||
var enabled = _service.ForwardToAll();
|
||||
|
||||
@@ -231,7 +231,7 @@ public partial class Administration
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task ShardStats(int page = 1)
|
||||
public async Task ShardStats(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return;
|
||||
@@ -284,7 +284,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task RestartShard(int shardId)
|
||||
public async Task RestartShard(int shardId)
|
||||
{
|
||||
var success = _coord.RestartShard(shardId);
|
||||
if (success)
|
||||
@@ -295,12 +295,12 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task Leave([Leftover] string guildStr)
|
||||
public Task Leave([Leftover] string guildStr)
|
||||
=> _service.LeaveGuild(guildStr);
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task DeleteEmptyServers()
|
||||
public async Task DeleteEmptyServers()
|
||||
{
|
||||
await ctx.Channel.TriggerTypingAsync();
|
||||
|
||||
@@ -331,7 +331,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task Die(bool graceful = false)
|
||||
public async Task Die(bool graceful = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -350,7 +350,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task Restart()
|
||||
public async Task Restart()
|
||||
{
|
||||
var success = _coord.RestartBot();
|
||||
if (!success)
|
||||
@@ -365,7 +365,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task SetName([Leftover] string newName)
|
||||
public async Task SetName([Leftover] string newName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(newName))
|
||||
return;
|
||||
@@ -386,7 +386,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageNicknames)]
|
||||
[BotPerm(GuildPerm.ChangeNickname)]
|
||||
[Priority(0)]
|
||||
public async partial Task SetNick([Leftover] string newNick = null)
|
||||
public async Task SetNick([Leftover] string newNick = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(newNick))
|
||||
return;
|
||||
@@ -400,7 +400,7 @@ public partial class Administration
|
||||
[BotPerm(GuildPerm.ManageNicknames)]
|
||||
[UserPerm(GuildPerm.ManageNicknames)]
|
||||
[Priority(1)]
|
||||
public async partial Task SetNick(IGuildUser gu, [Leftover] string newNick = null)
|
||||
public async Task SetNick(IGuildUser gu, [Leftover] string newNick = null)
|
||||
{
|
||||
var sg = (SocketGuild)ctx.Guild;
|
||||
if (sg.OwnerId == gu.Id
|
||||
@@ -417,7 +417,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task SetStatus([Leftover] SettableUserStatus status)
|
||||
public async Task SetStatus([Leftover] SettableUserStatus status)
|
||||
{
|
||||
await _client.SetStatusAsync(SettableUserStatusToUserStatus(status));
|
||||
|
||||
@@ -426,7 +426,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task SetAvatar([Leftover] string img = null)
|
||||
public async Task SetAvatar([Leftover] string img = null)
|
||||
{
|
||||
var success = await _service.SetAvatar(img);
|
||||
|
||||
@@ -436,7 +436,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task SetGame(ActivityType type, [Leftover] string game = null)
|
||||
public async Task SetGame(ActivityType type, [Leftover] string game = null)
|
||||
{
|
||||
var rep = new ReplacementBuilder().WithDefault(Context).Build();
|
||||
|
||||
@@ -447,7 +447,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task SetStream(string url, [Leftover] string name = null)
|
||||
public async Task SetStream(string url, [Leftover] string name = null)
|
||||
{
|
||||
name ??= "";
|
||||
|
||||
@@ -458,7 +458,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task Send(string where, [Leftover] SmartText text = null)
|
||||
public async Task Send(string where, [Leftover] SmartText text = null)
|
||||
{
|
||||
var ids = where.Split('|');
|
||||
if (ids.Length != 2)
|
||||
@@ -504,7 +504,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task StringsReload()
|
||||
public async Task StringsReload()
|
||||
{
|
||||
_strings.Reload();
|
||||
await _medusaLoader.ReloadStrings();
|
||||
@@ -513,7 +513,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task CoordReload()
|
||||
public async Task CoordReload()
|
||||
{
|
||||
await _coord.Reload();
|
||||
await ctx.OkAsync();
|
||||
|
@@ -13,7 +13,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[BotPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task AdSarm()
|
||||
public async Task AdSarm()
|
||||
{
|
||||
var newVal = _service.ToggleAdSarm(ctx.Guild.Id);
|
||||
|
||||
@@ -28,7 +28,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[Priority(1)]
|
||||
public partial Task Asar([Leftover] IRole role)
|
||||
public Task Asar([Leftover] IRole role)
|
||||
=> Asar(0, role);
|
||||
|
||||
[Cmd]
|
||||
@@ -36,7 +36,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[Priority(0)]
|
||||
public async partial Task Asar(int group, [Leftover] IRole role)
|
||||
public async Task Asar(int group, [Leftover] IRole role)
|
||||
{
|
||||
var guser = (IGuildUser)ctx.User;
|
||||
if (ctx.User.Id != guser.Guild.OwnerId && guser.GetRoles().Max(x => x.Position) <= role.Position)
|
||||
@@ -58,7 +58,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[Priority(0)]
|
||||
public async partial Task Sargn(int group, [Leftover] string name = null)
|
||||
public async Task Sargn(int group, [Leftover] string name = null)
|
||||
{
|
||||
var set = await _service.SetNameAsync(ctx.Guild.Id, group, name);
|
||||
|
||||
@@ -74,7 +74,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task Rsar([Leftover] IRole role)
|
||||
public async Task Rsar([Leftover] IRole role)
|
||||
{
|
||||
var guser = (IGuildUser)ctx.User;
|
||||
if (ctx.User.Id != guser.Guild.OwnerId && guser.GetRoles().Max(x => x.Position) <= role.Position)
|
||||
@@ -89,7 +89,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Lsar(int page = 1)
|
||||
public async Task Lsar(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return;
|
||||
@@ -149,7 +149,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task Togglexclsar()
|
||||
public async Task Togglexclsar()
|
||||
{
|
||||
var areExclusive = _service.ToggleEsar(ctx.Guild.Id);
|
||||
if (areExclusive)
|
||||
@@ -162,7 +162,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
public async partial Task RoleLevelReq(int level, [Leftover] IRole role)
|
||||
public async Task RoleLevelReq(int level, [Leftover] IRole role)
|
||||
{
|
||||
if (level < 0)
|
||||
return;
|
||||
@@ -181,7 +181,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Iam([Leftover] IRole role)
|
||||
public async Task Iam([Leftover] IRole role)
|
||||
{
|
||||
var guildUser = (IGuildUser)ctx.User;
|
||||
|
||||
@@ -208,7 +208,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Iamnot([Leftover] IRole role)
|
||||
public async Task Iamnot([Leftover] IRole role)
|
||||
{
|
||||
var guildUser = (IGuildUser)ctx.User;
|
||||
|
||||
|
@@ -13,7 +13,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task LogServer(PermissionAction action)
|
||||
public async Task LogServer(PermissionAction action)
|
||||
{
|
||||
await _service.LogServer(ctx.Guild.Id, ctx.Channel.Id, action.Value);
|
||||
if (action.Value)
|
||||
@@ -26,7 +26,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task LogIgnore()
|
||||
public async Task LogIgnore()
|
||||
{
|
||||
var settings = _service.GetGuildLogSettings(ctx.Guild.Id);
|
||||
|
||||
@@ -53,7 +53,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task LogIgnore([Leftover] ITextChannel target)
|
||||
public async Task LogIgnore([Leftover] ITextChannel target)
|
||||
{
|
||||
var removed = _service.LogIgnore(ctx.Guild.Id, target.Id, IgnoredItemType.Channel);
|
||||
|
||||
@@ -73,7 +73,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task LogIgnore([Leftover] IUser target)
|
||||
public async Task LogIgnore([Leftover] IUser target)
|
||||
{
|
||||
var removed = _service.LogIgnore(ctx.Guild.Id, target.Id, IgnoredItemType.User);
|
||||
|
||||
@@ -93,7 +93,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task LogEvents()
|
||||
public async Task LogEvents()
|
||||
{
|
||||
var logSetting = _service.GetGuildLogSettings(ctx.Guild.Id);
|
||||
var str = string.Join("\n",
|
||||
@@ -152,7 +152,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[OwnerOnly]
|
||||
public async partial Task Log(LogType type)
|
||||
public async Task Log(LogType type)
|
||||
{
|
||||
var val = _service.Log(ctx.Guild.Id, ctx.Channel.Id, type);
|
||||
|
||||
|
@@ -10,7 +10,7 @@ public partial class Administration
|
||||
{
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Timezones(int page = 1)
|
||||
public async Task Timezones(int page = 1)
|
||||
{
|
||||
page--;
|
||||
|
||||
@@ -48,13 +48,13 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Timezone()
|
||||
public async Task Timezone()
|
||||
=> await ReplyConfirmLocalizedAsync(strs.timezone_guild(_service.GetTimeZoneOrUtc(ctx.Guild.Id)));
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task Timezone([Leftover] string id)
|
||||
public async Task Timezone([Leftover] string id)
|
||||
{
|
||||
TimeZoneInfo tz;
|
||||
try { tz = TimeZoneInfo.FindSystemTimeZoneById(id); }
|
||||
|
@@ -51,13 +51,13 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public partial Task Warn(IGuildUser user, [Leftover] string reason = null)
|
||||
public Task Warn(IGuildUser user, [Leftover] string reason = null)
|
||||
=> Warn(1, user, reason);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task Warn(int weight, IGuildUser user, [Leftover] string reason = null)
|
||||
public async Task Warn(int weight, IGuildUser user, [Leftover] string reason = null)
|
||||
{
|
||||
if (weight <= 0)
|
||||
return;
|
||||
@@ -116,7 +116,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[NadekoOptions(typeof(WarnExpireOptions))]
|
||||
[Priority(1)]
|
||||
public async partial Task WarnExpire()
|
||||
public async Task WarnExpire()
|
||||
{
|
||||
var expireDays = await _service.GetWarnExpire(ctx.Guild.Id);
|
||||
|
||||
@@ -131,7 +131,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[NadekoOptions(typeof(WarnExpireOptions))]
|
||||
[Priority(2)]
|
||||
public async partial Task WarnExpire(int days, params string[] args)
|
||||
public async Task WarnExpire(int days, params string[] args)
|
||||
{
|
||||
if (days is < 0 or > 366)
|
||||
return;
|
||||
@@ -157,7 +157,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[Priority(2)]
|
||||
public partial Task Warnlog(int page, [Leftover] IGuildUser user = null)
|
||||
public Task Warnlog(int page, [Leftover] IGuildUser user = null)
|
||||
{
|
||||
user ??= (IGuildUser)ctx.User;
|
||||
|
||||
@@ -167,7 +167,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(3)]
|
||||
public partial Task Warnlog(IGuildUser user = null)
|
||||
public Task Warnlog(IGuildUser user = null)
|
||||
{
|
||||
user ??= (IGuildUser)ctx.User;
|
||||
|
||||
@@ -180,14 +180,14 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[Priority(0)]
|
||||
public partial Task Warnlog(int page, ulong userId)
|
||||
public Task Warnlog(int page, ulong userId)
|
||||
=> InternalWarnlog(userId, page - 1);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[Priority(1)]
|
||||
public partial Task Warnlog(ulong userId)
|
||||
public Task Warnlog(ulong userId)
|
||||
=> InternalWarnlog(userId, 0);
|
||||
|
||||
private async Task InternalWarnlog(ulong userId, int inputPage)
|
||||
@@ -241,7 +241,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task WarnlogAll(int page = 1)
|
||||
public async Task WarnlogAll(int page = 1)
|
||||
{
|
||||
if (--page < 0)
|
||||
return;
|
||||
@@ -275,13 +275,13 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public partial Task Warnclear(IGuildUser user, int index = 0)
|
||||
public Task Warnclear(IGuildUser user, int index = 0)
|
||||
=> Warnclear(user.Id, index);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task Warnclear(ulong userId, int index = 0)
|
||||
public async Task Warnclear(ulong userId, int index = 0)
|
||||
{
|
||||
if (index < 0)
|
||||
return;
|
||||
@@ -302,7 +302,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[Priority(1)]
|
||||
public async partial Task WarnPunish(
|
||||
public async Task WarnPunish(
|
||||
int number,
|
||||
AddRole _,
|
||||
IRole role,
|
||||
@@ -338,7 +338,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task WarnPunish(int number, PunishmentAction punish, StoopidTime time = null)
|
||||
public async Task WarnPunish(int number, PunishmentAction punish, StoopidTime time = null)
|
||||
{
|
||||
// this should never happen. Addrole has its own method with higher priority
|
||||
// also disallow warn punishment for getting warned
|
||||
@@ -366,7 +366,7 @@ public partial class Administration
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task WarnPunish(int number)
|
||||
public async Task WarnPunish(int number)
|
||||
{
|
||||
if (!_service.WarnPunishRemove(ctx.Guild.Id, number))
|
||||
return;
|
||||
@@ -376,7 +376,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task WarnPunishList()
|
||||
public async Task WarnPunishList()
|
||||
{
|
||||
var ps = _service.WarnPunishList(ctx.Guild.Id);
|
||||
|
||||
@@ -398,7 +398,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[Priority(1)]
|
||||
public async partial Task Ban(StoopidTime time, IUser user, [Leftover] string msg = null)
|
||||
public async Task Ban(StoopidTime time, IUser user, [Leftover] string msg = null)
|
||||
{
|
||||
if (time.Time > TimeSpan.FromDays(49))
|
||||
return;
|
||||
@@ -446,7 +446,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[Priority(0)]
|
||||
public async partial Task Ban(ulong userId, [Leftover] string msg = null)
|
||||
public async Task Ban(ulong userId, [Leftover] string msg = null)
|
||||
{
|
||||
var user = await ((DiscordSocketClient)Context.Client).Rest.GetGuildUserAsync(ctx.Guild.Id, userId);
|
||||
if (user is null)
|
||||
@@ -467,7 +467,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[Priority(2)]
|
||||
public async partial Task Ban(IGuildUser user, [Leftover] string msg = null)
|
||||
public async Task Ban(IGuildUser user, [Leftover] string msg = null)
|
||||
{
|
||||
if (!await CheckRoleHierarchy(user))
|
||||
return;
|
||||
@@ -504,7 +504,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task BanMessage([Leftover] string message = null)
|
||||
public async Task BanMessage([Leftover] string message = null)
|
||||
{
|
||||
if (message is null)
|
||||
{
|
||||
@@ -527,7 +527,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task BanMsgReset()
|
||||
public async Task BanMsgReset()
|
||||
{
|
||||
_service.SetBanTemplate(ctx.Guild.Id, null);
|
||||
await ctx.OkAsync();
|
||||
@@ -538,7 +538,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[Priority(0)]
|
||||
public partial Task BanMessageTest([Leftover] string reason = null)
|
||||
public Task BanMessageTest([Leftover] string reason = null)
|
||||
=> InternalBanMessageTest(reason, null);
|
||||
|
||||
[Cmd]
|
||||
@@ -546,7 +546,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[Priority(1)]
|
||||
public partial Task BanMessageTest(StoopidTime duration, [Leftover] string reason = null)
|
||||
public Task BanMessageTest(StoopidTime duration, [Leftover] string reason = null)
|
||||
=> InternalBanMessageTest(reason, duration.Time);
|
||||
|
||||
private async Task InternalBanMessageTest(string reason, TimeSpan? duration)
|
||||
@@ -576,7 +576,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task Unban([Leftover] string user)
|
||||
public async Task Unban([Leftover] string user)
|
||||
{
|
||||
var bans = await ctx.Guild.GetBansAsync().FlattenAsync();
|
||||
|
||||
@@ -595,7 +595,7 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task Unban(ulong userId)
|
||||
public async Task Unban(ulong userId)
|
||||
{
|
||||
var bun = await ctx.Guild.GetBanAsync(userId);
|
||||
|
||||
@@ -619,14 +619,14 @@ public partial class Administration
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.KickMembers | GuildPerm.ManageMessages)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
public partial Task Softban(IGuildUser user, [Leftover] string msg = null)
|
||||
public Task Softban(IGuildUser user, [Leftover] string msg = null)
|
||||
=> SoftbanInternal(user, msg);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.KickMembers | GuildPerm.ManageMessages)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
public async partial Task Softban(ulong userId, [Leftover] string msg = null)
|
||||
public async Task Softban(ulong userId, [Leftover] string msg = null)
|
||||
{
|
||||
var user = await ((DiscordSocketClient)Context.Client).Rest.GetGuildUserAsync(ctx.Guild.Id, userId);
|
||||
if (user is null)
|
||||
@@ -672,7 +672,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.KickMembers)]
|
||||
[BotPerm(GuildPerm.KickMembers)]
|
||||
[Priority(1)]
|
||||
public partial Task Kick(IGuildUser user, [Leftover] string msg = null)
|
||||
public Task Kick(IGuildUser user, [Leftover] string msg = null)
|
||||
=> KickInternal(user, msg);
|
||||
|
||||
[Cmd]
|
||||
@@ -680,7 +680,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.KickMembers)]
|
||||
[BotPerm(GuildPerm.KickMembers)]
|
||||
[Priority(0)]
|
||||
public async partial Task Kick(ulong userId, [Leftover] string msg = null)
|
||||
public async Task Kick(ulong userId, [Leftover] string msg = null)
|
||||
{
|
||||
var user = await ((DiscordSocketClient)Context.Client).Rest.GetGuildUserAsync(ctx.Guild.Id, userId);
|
||||
if (user is null)
|
||||
@@ -724,7 +724,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[Ratelimit(30)]
|
||||
public async partial Task MassBan(params string[] userStrings)
|
||||
public async Task MassBan(params string[] userStrings)
|
||||
{
|
||||
if (userStrings.Length == 0)
|
||||
return;
|
||||
@@ -800,7 +800,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.BanMembers)]
|
||||
[BotPerm(GuildPerm.BanMembers)]
|
||||
[OwnerOnly]
|
||||
public async partial Task MassKill([Leftover] string people)
|
||||
public async Task MassKill([Leftover] string people)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(people))
|
||||
return;
|
||||
|
@@ -12,7 +12,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task VcRoleRm(ulong vcId)
|
||||
public async Task VcRoleRm(ulong vcId)
|
||||
{
|
||||
if (_service.RemoveVcRole(ctx.Guild.Id, vcId))
|
||||
await ReplyConfirmLocalizedAsync(strs.vcrole_removed(Format.Bold(vcId.ToString())));
|
||||
@@ -24,7 +24,7 @@ public partial class Administration
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task VcRole([Leftover] IRole role = null)
|
||||
public async Task VcRole([Leftover] IRole role = null)
|
||||
{
|
||||
var user = (IGuildUser)ctx.User;
|
||||
|
||||
@@ -50,7 +50,7 @@ public partial class Administration
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task VcRoleList()
|
||||
public async Task VcRoleList()
|
||||
{
|
||||
var guild = (SocketGuild)ctx.Guild;
|
||||
string text;
|
||||
|
Reference in New Issue
Block a user