Exemple #1
0
        public async Task RestrictCategoryToStaff(ulong categoryId, ulong staffRoleId)
        {
            var category     = _discordGuildService.GetCategory(categoryId);
            var everyoneRole = _discordGuildService.GetEveryoneRole();
            var staffRole    = _discordGuildService.GetRole(staffRoleId);

            await category.AddPermissionOverwriteAsync(everyoneRole, OverwritePermissions.DenyAll(category));

            await category.AddPermissionOverwriteAsync(staffRole,
                                                       new OverwritePermissions(addReactions : PermValue.Allow,
                                                                                viewChannel : PermValue.Allow,
                                                                                sendMessages : PermValue.Allow,
                                                                                embedLinks : PermValue.Allow,
                                                                                manageMessages : PermValue.Allow,
                                                                                attachFiles : PermValue.Allow,
                                                                                readMessageHistory : PermValue.Allow,
                                                                                useExternalEmojis : PermValue.Allow));
        }