Esempio n. 1
0
        // TODO DUPLICATE REMOVE
        private bool AllowedToRun(BotPermissionType type)
        {
            var channelSettings = DatabaseManager.Instance().GetChannelSetting(Context.Message.Channel.Id);

            if (Context.Message.Author.Id != Program.Owner &&
                !((BotPermissionType)channelSettings?.ChannelPermissionFlags).HasFlag(type))
            {
#if DEBUG
                Context.Channel.SendMessageAsync("blocked by perms", false);
#endif
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public static bool AllowedToRun(BotPermissionType type, ulong channelId, ulong authorId)
        {
            var channelSettings = DatabaseManager.Instance().GetChannelSetting(channelId);

            return(authorId == Program.ApplicationSetting.Owner || ((BotPermissionType)channelSettings?.ChannelPermissionFlags).HasFlag(type));
        }