Skip to content

Commit 3e34c37

Browse files
committed
Ping roles if you move the course from past courses
1 parent 5b3a174 commit 3e34c37

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

commands/owner/csCreateChannels.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ export default {
170170

171171
// Ping members who have this role
172172
const role = msgInt.guild.roles.cache.find((role) => {
173-
// console.log(
174-
// `${cleanRoleString(role.name)}:${cleanChannelString(
175-
// courses[index].CODE
176-
// )}`
177-
// );
178173
return (
179174
cleanRoleString(role.name) ==
180175
cleanChannelString(courses[index].CODE)
@@ -204,6 +199,17 @@ export default {
204199

205200
courses[index].CHANNEL_ID = channel.id;
206201
courses[index].save();
202+
// Ping members who have this role
203+
const role = msgInt.guild.roles.cache.find((role) => {
204+
return (
205+
cleanRoleString(role.name) ==
206+
cleanChannelString(courses[index].CODE)
207+
);
208+
});
209+
if (role !== undefined) {
210+
//Ping member
211+
channel.send(`Hey! <@&${role.id}> here is the channel for you!`);
212+
}
207213
} else if (
208214
channel.parent !== null &&
209215
channel.parent.name.startsWith(category_name)

0 commit comments

Comments
 (0)