mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48: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:
@@ -10,7 +10,7 @@ public partial class Utility
|
||||
public partial class CalcCommands : NadekoModule
|
||||
{
|
||||
[Cmd]
|
||||
public async partial Task Calculate([Leftover] string expression)
|
||||
public async Task Calculate([Leftover] string expression)
|
||||
{
|
||||
var expr = new Expression(expression, EvaluateOptions.IgnoreCase | EvaluateOptions.NoCache);
|
||||
expr.EvaluateParameter += Expr_EvaluateParameter;
|
||||
@@ -35,7 +35,7 @@ public partial class Utility
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task CalcOps()
|
||||
public async Task CalcOps()
|
||||
{
|
||||
var selection = typeof(Math).GetTypeInfo()
|
||||
.GetMethods()
|
||||
|
@@ -23,7 +23,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task AliasesClear()
|
||||
public async Task AliasesClear()
|
||||
{
|
||||
var count = _service.ClearAliases(ctx.Guild.Id);
|
||||
await ReplyConfirmLocalizedAsync(strs.aliases_cleared(count));
|
||||
@@ -32,7 +32,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Alias(string trigger, [Leftover] string mapping = null)
|
||||
public async Task Alias(string trigger, [Leftover] string mapping = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(trigger))
|
||||
return;
|
||||
@@ -106,7 +106,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task AliasList(int page = 1)
|
||||
public async Task AliasList(int page = 1)
|
||||
{
|
||||
page -= 1;
|
||||
|
||||
|
@@ -12,7 +12,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task ConfigReload(string name)
|
||||
public async Task ConfigReload(string name)
|
||||
{
|
||||
var setting = _settingServices.FirstOrDefault(x
|
||||
=> x.Name.StartsWith(name, StringComparison.InvariantCultureIgnoreCase));
|
||||
@@ -35,7 +35,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task Config(string name = null, string prop = null, [Leftover] string value = null)
|
||||
public async Task Config(string name = null, string prop = null, [Leftover] string value = null)
|
||||
{
|
||||
var configNames = _settingServices.Select(x => x.Name);
|
||||
|
||||
|
@@ -23,12 +23,12 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public partial Task ServerInfo([Leftover] string guildName)
|
||||
public Task ServerInfo([Leftover] string guildName)
|
||||
=> InternalServerInfo(guildName);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public partial Task ServerInfo()
|
||||
public Task ServerInfo()
|
||||
=> InternalServerInfo();
|
||||
|
||||
private async Task InternalServerInfo(string guildName = null)
|
||||
@@ -81,7 +81,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task ChannelInfo(ITextChannel channel = null)
|
||||
public async Task ChannelInfo(ITextChannel channel = null)
|
||||
{
|
||||
var ch = channel ?? (ITextChannel)ctx.Channel;
|
||||
if (ch is null)
|
||||
@@ -100,7 +100,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task UserInfo(IGuildUser usr = null)
|
||||
public async Task UserInfo(IGuildUser usr = null)
|
||||
{
|
||||
var user = usr ?? ctx.User as IGuildUser;
|
||||
|
||||
@@ -143,7 +143,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[OwnerOnly]
|
||||
public async partial Task Activity(int page = 1)
|
||||
public async Task Activity(int page = 1)
|
||||
{
|
||||
const int activityPerPage = 10;
|
||||
page -= 1;
|
||||
|
@@ -13,7 +13,7 @@ public partial class Utility
|
||||
[BotPerm(ChannelPerm.CreateInstantInvite)]
|
||||
[UserPerm(ChannelPerm.CreateInstantInvite)]
|
||||
[NadekoOptions(typeof(InviteService.Options))]
|
||||
public async partial Task InviteCreate(params string[] args)
|
||||
public async Task InviteCreate(params string[] args)
|
||||
{
|
||||
var (opts, success) = OptionsParser.ParseFrom(new InviteService.Options(), args);
|
||||
if (!success)
|
||||
@@ -29,7 +29,7 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[BotPerm(ChannelPerm.ManageChannels)]
|
||||
[UserPerm(ChannelPerm.ManageChannels)]
|
||||
public async partial Task InviteList(int page = 1, [Leftover] ITextChannel ch = null)
|
||||
public async Task InviteList(int page = 1, [Leftover] ITextChannel ch = null)
|
||||
{
|
||||
if (--page < 0)
|
||||
return;
|
||||
@@ -73,7 +73,7 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[BotPerm(ChannelPerm.ManageChannels)]
|
||||
[UserPerm(ChannelPerm.ManageChannels)]
|
||||
public async partial Task InviteDelete(int index)
|
||||
public async Task InviteDelete(int index)
|
||||
{
|
||||
if (--index < 0)
|
||||
return;
|
||||
|
@@ -18,19 +18,19 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[Priority(2)]
|
||||
public partial Task Patron()
|
||||
public Task Patron()
|
||||
=> InternalPatron(ctx.User);
|
||||
|
||||
[Cmd]
|
||||
[Priority(0)]
|
||||
[OwnerOnly]
|
||||
public partial Task Patron(IUser user)
|
||||
public Task Patron(IUser user)
|
||||
=> InternalPatron(user);
|
||||
|
||||
[Cmd]
|
||||
[Priority(0)]
|
||||
[OwnerOnly]
|
||||
public async partial Task PatronMessage(PatronTier tierAndHigher, string message)
|
||||
public async Task PatronMessage(PatronTier tierAndHigher, string message)
|
||||
{
|
||||
_ = ctx.Channel.TriggerTypingAsync();
|
||||
var result = await _service.SendMessageToPatronsAsync(tierAndHigher, message);
|
||||
@@ -43,7 +43,7 @@ public partial class Utility
|
||||
|
||||
// [Cmd]
|
||||
// [OwnerOnly]
|
||||
// public async partial Task PatronGift(IUser user, int amount)
|
||||
// public async Task PatronGift(IUser user, int amount)
|
||||
// {
|
||||
// // i can't figure out a good way to gift more than one month at the moment.
|
||||
//
|
||||
|
@@ -44,13 +44,13 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(1)]
|
||||
public partial Task ListQuotes(OrderType order = OrderType.Keyword)
|
||||
public Task ListQuotes(OrderType order = OrderType.Keyword)
|
||||
=> ListQuotes(1, order);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(0)]
|
||||
public async partial Task ListQuotes(int page = 1, OrderType order = OrderType.Keyword)
|
||||
public async Task ListQuotes(int page = 1, OrderType order = OrderType.Keyword)
|
||||
{
|
||||
page -= 1;
|
||||
if (page < 0)
|
||||
@@ -75,7 +75,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task QuotePrint([Leftover] string keyword)
|
||||
public async Task QuotePrint([Leftover] string keyword)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(keyword))
|
||||
return;
|
||||
@@ -106,7 +106,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task QuoteShow(int id)
|
||||
public async Task QuoteShow(int id)
|
||||
{
|
||||
Quote quote;
|
||||
await using (var uow = _db.GetDbContext())
|
||||
@@ -160,18 +160,18 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(0)]
|
||||
public partial Task QuoteSearch(string textOrAuthor)
|
||||
public Task QuoteSearch(string textOrAuthor)
|
||||
=> QuoteSearchinternalAsync(null, textOrAuthor);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(1)]
|
||||
public partial Task QuoteSearch(string keyword, [Leftover] string textOrAuthor)
|
||||
public Task QuoteSearch(string keyword, [Leftover] string textOrAuthor)
|
||||
=> QuoteSearchinternalAsync(keyword, textOrAuthor);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task QuoteId(int id)
|
||||
public async Task QuoteId(int id)
|
||||
{
|
||||
if (id < 0)
|
||||
return;
|
||||
@@ -203,7 +203,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task QuoteAdd(string keyword, [Leftover] string text)
|
||||
public async Task QuoteAdd(string keyword, [Leftover] string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(keyword) || string.IsNullOrWhiteSpace(text))
|
||||
return;
|
||||
@@ -229,7 +229,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task QuoteDelete(int id)
|
||||
public async Task QuoteDelete(int id)
|
||||
{
|
||||
var hasManageMessages = ((IGuildUser)ctx.Message.Author).GuildPermissions.ManageMessages;
|
||||
|
||||
@@ -259,7 +259,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task DelAllQuotes([Leftover] string keyword)
|
||||
public async Task DelAllQuotes([Leftover] string keyword)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(keyword))
|
||||
return;
|
||||
@@ -279,7 +279,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
public async partial Task QuotesExport()
|
||||
public async Task QuotesExport()
|
||||
{
|
||||
IEnumerable<Quote> quotes;
|
||||
await using (var uow = _db.GetDbContext())
|
||||
@@ -303,7 +303,7 @@ public partial class Utility
|
||||
#if GLOBAL_NADEKO
|
||||
[OwnerOnly]
|
||||
#endif
|
||||
public async partial Task QuotesImport([Leftover] string input = null)
|
||||
public async Task QuotesImport([Leftover] string input = null)
|
||||
{
|
||||
input = input?.Trim();
|
||||
|
||||
|
@@ -37,7 +37,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[Priority(1)]
|
||||
public async partial Task Remind(MeOrHere meorhere, [Leftover] string remindString)
|
||||
public async Task Remind(MeOrHere meorhere, [Leftover] string remindString)
|
||||
{
|
||||
if (!_service.TryParseRemindMessage(remindString, out var remindData))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public async partial Task Remind(ITextChannel channel, [Leftover] string remindString)
|
||||
public async Task Remind(ITextChannel channel, [Leftover] string remindString)
|
||||
{
|
||||
var perms = ((IGuildUser)ctx.User).GetPermissions(channel);
|
||||
if (!perms.SendMessages || !perms.ViewChannel)
|
||||
@@ -82,12 +82,12 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(0)]
|
||||
public partial Task RemindList(Server _, int page = 1)
|
||||
public Task RemindList(Server _, int page = 1)
|
||||
=> RemindListInternal(page, true);
|
||||
|
||||
[Cmd]
|
||||
[Priority(1)]
|
||||
public partial Task RemindList(int page = 1)
|
||||
public Task RemindList(int page = 1)
|
||||
=> RemindListInternal(page, false);
|
||||
|
||||
private async Task RemindListInternal(int page, bool isServer)
|
||||
@@ -134,12 +134,12 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.Administrator)]
|
||||
[Priority(0)]
|
||||
public partial Task RemindDelete(Server _, int index)
|
||||
public Task RemindDelete(Server _, int index)
|
||||
=> RemindDelete(index, true);
|
||||
|
||||
[Cmd]
|
||||
[Priority(1)]
|
||||
public partial Task RemindDelete(int index)
|
||||
public Task RemindDelete(int index)
|
||||
=> RemindDelete(index, false);
|
||||
|
||||
private async Task RemindDelete(int index, bool isServer)
|
||||
|
@@ -12,7 +12,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task RepeatInvoke(int index)
|
||||
public async Task RepeatInvoke(int index)
|
||||
{
|
||||
if (--index < 0)
|
||||
return;
|
||||
@@ -25,7 +25,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task RepeatRemove(int index)
|
||||
public async Task RepeatRemove(int index)
|
||||
{
|
||||
if (--index < 0)
|
||||
return;
|
||||
@@ -47,7 +47,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task RepeatRedundant(int index)
|
||||
public async Task RepeatRedundant(int index)
|
||||
{
|
||||
if (--index < 0)
|
||||
return;
|
||||
@@ -70,28 +70,28 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(-1)]
|
||||
public partial Task Repeat([Leftover] string message)
|
||||
public Task Repeat([Leftover] string message)
|
||||
=> Repeat(null, null, message);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public partial Task Repeat(StoopidTime interval, [Leftover] string message)
|
||||
public Task Repeat(StoopidTime interval, [Leftover] string message)
|
||||
=> Repeat(null, interval, message);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(1)]
|
||||
public partial Task Repeat(GuildDateTime dt, [Leftover] string message)
|
||||
public Task Repeat(GuildDateTime dt, [Leftover] string message)
|
||||
=> Repeat(dt, null, message);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(2)]
|
||||
public async partial Task Repeat(GuildDateTime? dt, StoopidTime? interval, [Leftover] string message)
|
||||
public async Task Repeat(GuildDateTime? dt, StoopidTime? interval, [Leftover] string message)
|
||||
{
|
||||
var startTimeOfDay = dt?.InputTimeUtc.TimeOfDay;
|
||||
// if interval not null, that means user specified it (don't change it)
|
||||
@@ -134,7 +134,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task RepeatList()
|
||||
public async Task RepeatList()
|
||||
{
|
||||
var repeaters = _service.GetRepeaters(ctx.Guild.Id);
|
||||
if (repeaters.Count == 0)
|
||||
|
@@ -12,7 +12,7 @@ public partial class Utility
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task StreamRole(IRole fromRole, IRole addRole)
|
||||
public async Task StreamRole(IRole fromRole, IRole addRole)
|
||||
{
|
||||
await _service.SetStreamRole(fromRole, addRole);
|
||||
|
||||
@@ -24,7 +24,7 @@ public partial class Utility
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task StreamRole()
|
||||
public async Task StreamRole()
|
||||
{
|
||||
await _service.StopStreamRole(ctx.Guild);
|
||||
await ReplyConfirmLocalizedAsync(strs.stream_role_disabled);
|
||||
@@ -34,7 +34,7 @@ public partial class Utility
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task StreamRoleKeyword([Leftover] string keyword = null)
|
||||
public async Task StreamRoleKeyword([Leftover] string keyword = null)
|
||||
{
|
||||
var kw = await _service.SetKeyword(ctx.Guild, keyword);
|
||||
|
||||
@@ -48,7 +48,7 @@ public partial class Utility
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task StreamRoleBlacklist(AddRemove action, [Leftover] IGuildUser user)
|
||||
public async Task StreamRoleBlacklist(AddRemove action, [Leftover] IGuildUser user)
|
||||
{
|
||||
var success = await _service.ApplyListAction(StreamRoleListType.Blacklist,
|
||||
ctx.Guild,
|
||||
@@ -73,7 +73,7 @@ public partial class Utility
|
||||
[BotPerm(GuildPerm.ManageRoles)]
|
||||
[UserPerm(GuildPerm.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task StreamRoleWhitelist(AddRemove action, [Leftover] IGuildUser user)
|
||||
public async Task StreamRoleWhitelist(AddRemove action, [Leftover] IGuildUser user)
|
||||
{
|
||||
var success = await _service.ApplyListAction(StreamRoleListType.Whitelist,
|
||||
ctx.Guild,
|
||||
|
@@ -9,7 +9,7 @@ public partial class Utility
|
||||
public partial class UnitConverterCommands : NadekoModule<ConverterService>
|
||||
{
|
||||
[Cmd]
|
||||
public async partial Task ConvertList()
|
||||
public async Task ConvertList()
|
||||
{
|
||||
var units = await _service.GetUnitsAsync();
|
||||
|
||||
@@ -27,7 +27,7 @@ public partial class Utility
|
||||
|
||||
[Cmd]
|
||||
[Priority(0)]
|
||||
public async partial Task Convert(string origin, string target, decimal value)
|
||||
public async Task Convert(string origin, string target, decimal value)
|
||||
{
|
||||
var units = await _service.GetUnitsAsync();
|
||||
var originUnit = units.FirstOrDefault(x
|
||||
|
@@ -60,7 +60,7 @@ public partial class Utility : NadekoModule
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(1)]
|
||||
public async partial Task Say(ITextChannel channel, [Leftover] SmartText message)
|
||||
public async Task Say(ITextChannel channel, [Leftover] SmartText message)
|
||||
{
|
||||
var rep = new ReplacementBuilder()
|
||||
.WithDefault(ctx.User, channel, (SocketGuild)ctx.Guild, (DiscordSocketClient)ctx.Client)
|
||||
@@ -75,12 +75,12 @@ public partial class Utility : NadekoModule
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
[Priority(0)]
|
||||
public partial Task Say([Leftover] SmartText message)
|
||||
public Task Say([Leftover] SmartText message)
|
||||
=> Say((ITextChannel)ctx.Channel, message);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task WhosPlaying([Leftover] string game)
|
||||
public async Task WhosPlaying([Leftover] string game)
|
||||
{
|
||||
game = game?.Trim().ToUpperInvariant();
|
||||
if (string.IsNullOrWhiteSpace(game))
|
||||
@@ -117,7 +117,7 @@ public partial class Utility : NadekoModule
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(0)]
|
||||
public async partial Task InRole(int page, [Leftover] IRole role = null)
|
||||
public async Task InRole(int page, [Leftover] IRole role = null)
|
||||
{
|
||||
if (--page < 0)
|
||||
return;
|
||||
@@ -153,12 +153,12 @@ public partial class Utility : NadekoModule
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[Priority(1)]
|
||||
public partial Task InRole([Leftover] IRole role = null)
|
||||
public Task InRole([Leftover] IRole role = null)
|
||||
=> InRole(1, role);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task CheckPerms(MeOrBot who = MeOrBot.Me)
|
||||
public async Task CheckPerms(MeOrBot who = MeOrBot.Me)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
var user = who == MeOrBot.Me ? (IGuildUser)ctx.User : ((SocketGuild)ctx.Guild).CurrentUser;
|
||||
@@ -178,7 +178,7 @@ public partial class Utility : NadekoModule
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task UserId([Leftover] IGuildUser target = null)
|
||||
public async Task UserId([Leftover] IGuildUser target = null)
|
||||
{
|
||||
var usr = target ?? ctx.User;
|
||||
await ReplyConfirmLocalizedAsync(strs.userid("🆔",
|
||||
@@ -188,23 +188,23 @@ public partial class Utility : NadekoModule
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task RoleId([Leftover] IRole role)
|
||||
public async Task RoleId([Leftover] IRole role)
|
||||
=> await ReplyConfirmLocalizedAsync(strs.roleid("🆔",
|
||||
Format.Bold(role.ToString()),
|
||||
Format.Code(role.Id.ToString())));
|
||||
|
||||
[Cmd]
|
||||
public async partial Task ChannelId()
|
||||
public async Task ChannelId()
|
||||
=> await ReplyConfirmLocalizedAsync(strs.channelid("🆔", Format.Code(ctx.Channel.Id.ToString())));
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task ServerId()
|
||||
public async Task ServerId()
|
||||
=> await ReplyConfirmLocalizedAsync(strs.serverid("🆔", Format.Code(ctx.Guild.Id.ToString())));
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task Roles(IGuildUser target, int page = 1)
|
||||
public async Task Roles(IGuildUser target, int page = 1)
|
||||
{
|
||||
var guild = ctx.Guild;
|
||||
|
||||
@@ -248,12 +248,12 @@ public partial class Utility : NadekoModule
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public partial Task Roles(int page = 1)
|
||||
public Task Roles(int page = 1)
|
||||
=> Roles(null, page);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task ChannelTopic([Leftover] ITextChannel channel = null)
|
||||
public async Task ChannelTopic([Leftover] ITextChannel channel = null)
|
||||
{
|
||||
if (channel is null)
|
||||
channel = (ITextChannel)ctx.Channel;
|
||||
@@ -266,7 +266,7 @@ public partial class Utility : NadekoModule
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task Stats()
|
||||
public async Task Stats()
|
||||
{
|
||||
var ownerIds = string.Join("\n", _creds.OwnerIds);
|
||||
if (string.IsNullOrWhiteSpace(ownerIds))
|
||||
@@ -299,7 +299,7 @@ public partial class Utility : NadekoModule
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task
|
||||
public async Task
|
||||
Showemojis([Leftover] string _) // need to have the parameter so that the message.tags gets populated
|
||||
{
|
||||
var tags = ctx.Message.Tags.Where(t => t.Type == TagType.Emoji).Select(t => (Emote)t.Value);
|
||||
@@ -317,7 +317,7 @@ public partial class Utility : NadekoModule
|
||||
[BotPerm(GuildPerm.ManageEmojisAndStickers)]
|
||||
[UserPerm(GuildPerm.ManageEmojisAndStickers)]
|
||||
[Priority(2)]
|
||||
public partial Task EmojiAdd(string name, Emote emote)
|
||||
public Task EmojiAdd(string name, Emote emote)
|
||||
=> EmojiAdd(name, emote.Url);
|
||||
|
||||
[Cmd]
|
||||
@@ -325,7 +325,7 @@ public partial class Utility : NadekoModule
|
||||
[BotPerm(GuildPerm.ManageEmojisAndStickers)]
|
||||
[UserPerm(GuildPerm.ManageEmojisAndStickers)]
|
||||
[Priority(1)]
|
||||
public partial Task EmojiAdd(Emote emote)
|
||||
public Task EmojiAdd(Emote emote)
|
||||
=> EmojiAdd(emote.Name, emote.Url);
|
||||
|
||||
[Cmd]
|
||||
@@ -333,7 +333,7 @@ public partial class Utility : NadekoModule
|
||||
[BotPerm(GuildPerm.ManageEmojisAndStickers)]
|
||||
[UserPerm(GuildPerm.ManageEmojisAndStickers)]
|
||||
[Priority(0)]
|
||||
public async partial Task EmojiAdd(string name, string url = null)
|
||||
public async Task EmojiAdd(string name, string url = null)
|
||||
{
|
||||
name = name.Trim(':');
|
||||
|
||||
@@ -369,7 +369,7 @@ public partial class Utility : NadekoModule
|
||||
|
||||
[Cmd]
|
||||
[OwnerOnly]
|
||||
public async partial Task ListServers(int page = 1)
|
||||
public async Task ListServers(int page = 1)
|
||||
{
|
||||
page -= 1;
|
||||
|
||||
@@ -396,12 +396,12 @@ public partial class Utility : NadekoModule
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public partial Task ShowEmbed(ulong messageId)
|
||||
public Task ShowEmbed(ulong messageId)
|
||||
=> ShowEmbed((ITextChannel)ctx.Channel, messageId);
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async partial Task ShowEmbed(ITextChannel ch, ulong messageId)
|
||||
public async Task ShowEmbed(ITextChannel ch, ulong messageId)
|
||||
{
|
||||
var user = (IGuildUser)ctx.User;
|
||||
var perms = user.GetPermissions(ch);
|
||||
@@ -432,7 +432,7 @@ public partial class Utility : NadekoModule
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[OwnerOnly]
|
||||
public async partial Task SaveChat(int cnt)
|
||||
public async Task SaveChat(int cnt)
|
||||
{
|
||||
var msgs = new List<IMessage>(cnt);
|
||||
await ctx.Channel.GetMessagesAsync(cnt).ForEachAsync(dled => msgs.AddRange(dled));
|
||||
@@ -472,7 +472,7 @@ public partial class Utility : NadekoModule
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
public async partial Task Ping()
|
||||
public async Task Ping()
|
||||
{
|
||||
await sem.WaitAsync(5000);
|
||||
try
|
||||
@@ -493,7 +493,7 @@ public partial class Utility : NadekoModule
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[UserPerm(GuildPerm.ManageMessages)]
|
||||
public async partial Task VerboseError(bool? newstate = null)
|
||||
public async Task VerboseError(bool? newstate = null)
|
||||
{
|
||||
var state = _veService.ToggleVerboseErrors(ctx.Guild.Id, newstate);
|
||||
|
||||
|
@@ -19,7 +19,7 @@ public partial class Utility
|
||||
[Cmd]
|
||||
[NoPublicBot]
|
||||
[OwnerOnly]
|
||||
public async partial Task Eval([Leftover] string scriptText)
|
||||
public async Task Eval([Leftover] string scriptText)
|
||||
{
|
||||
_ = ctx.Channel.TriggerTypingAsync();
|
||||
|
||||
|
Reference in New Issue
Block a user