Skip to content

dev/fix-course-command-6 #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion commands/rolesPermOverride.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const in_overwrites = (overwrites, id) =>
async function editChannels(interaction, channels) {
for (const data of channels) {
const channel = data[1];

if (!channel) continue;

const is_valid = is_valid_course_name(channel.name);

if (!is_valid || channel.type !== "GUILD_TEXT") continue;
Expand Down Expand Up @@ -98,6 +101,9 @@ async function allFixed(interaction, channels) {
const unfixed = [];
for (const data of channels) {
const channel = data[1];

if (!channel) continue;

const fixed = await isFixed(interaction, channel);

if (!fixed) unfixed.push(channel.name);
Expand Down Expand Up @@ -143,7 +149,7 @@ module.exports = {

if (!interaction.options.getBoolean("singlechannel")) {
// Get all channels and run specified function
const channels = await interaction.guild.channels.fetch();
const channels = interaction.guild.channels.cache;

if (!interaction.options.getBoolean("check")) {
await editChannels(interaction, channels);
Expand Down