Files
archived-discord-bot/CompatBot/Commands/Attributes/LimitedToHelpChannel.cs
13xforever fbad33ea13 implemented some rudimentary psn api client
implemented psn crawling for ps3 game metadata (mostly for thumbnails)
implemented game thumbnails for game embeds
fixed usage of dbcontext
some other bugfixes
2018-08-05 20:54:36 +02:00

22 lines
708 B
C#

using System;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
namespace CompatBot.Commands.Attributes
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = false)]
internal class LimitedToHelpChannel: CheckBaseAttribute
{
public override Task<bool> ExecuteCheckAsync(CommandContext ctx, bool help)
{
if (ctx.Channel.IsPrivate || help)
return Task.FromResult(true);
if (ctx.Channel.Name.Equals("help", StringComparison.InvariantCultureIgnoreCase))
return Task.FromResult(true);
return Task.FromResult(false);
}
}
}