Implemented .linkonly (as an alternative to .imageonly). Updated pokaman with latest generations. Updated responses, fixed some warnings

This commit is contained in:
Kwoth
2022-07-27 03:14:47 +02:00
parent e20212a6cb
commit bb395f18a2
13 changed files with 3017 additions and 35 deletions

View File

@@ -32,10 +32,10 @@ public partial class Administration : NadekoModule<AdministrationService>
Inherit
}
private readonly ImageOnlyChannelService _imageOnly;
private readonly SomethingOnlyChannelService _somethingOnly;
public Administration(ImageOnlyChannelService imageOnly)
=> _imageOnly = imageOnly;
public Administration(SomethingOnlyChannelService somethingOnly)
=> _somethingOnly = somethingOnly;
[Cmd]
[RequireContext(ContextType.Guild)]
@@ -43,12 +43,25 @@ public partial class Administration : NadekoModule<AdministrationService>
[BotPerm(GuildPerm.ManageGuild)]
public async Task ImageOnlyChannel(StoopidTime time = null)
{
var newValue = _imageOnly.ToggleImageOnlyChannel(ctx.Guild.Id, ctx.Channel.Id);
var newValue = await _somethingOnly.ToggleImageOnlyChannelAsync(ctx.Guild.Id, ctx.Channel.Id);
if (newValue)
await ReplyConfirmLocalizedAsync(strs.imageonly_enable);
else
await ReplyPendingLocalizedAsync(strs.imageonly_disable);
}
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
[BotPerm(GuildPerm.ManageGuild)]
public async Task LinkOnlyChannel(StoopidTime time = null)
{
var newValue = await _somethingOnly.ToggleLinkOnlyChannelAsync(ctx.Guild.Id, ctx.Channel.Id);
if (newValue)
await ReplyConfirmLocalizedAsync(strs.linkonly_enable);
else
await ReplyPendingLocalizedAsync(strs.linkonly_disable);
}
[Cmd]
[RequireContext(ContextType.Guild)]