Skip to content

Commit

Permalink
Fix wrong subject/professor and undefined messageContent
Browse files Browse the repository at this point in the history
  • Loading branch information
Chr1s70ph committed Nov 5, 2021
1 parent 9a9e658 commit c4fd8fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/iCalReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ async function filterToadaysEvents(
if (thisWeeksEvents[entry].day == today.getDay()) {
var event = thisWeeksEvents[entry]
var summary = event.summary
//extract the subject after the "-" in the string
var subject = summary.split("-")[1]
//extract the subject after the first "-" in the string
var subject = summary.split(/-(.+)/)[1]

//extract the professors Name before the "-" in the string
var professor = summary.split("-")[0]
var professor = summary.split(/-(.+)/)[0]

var link = extractZoomLinks(event.description)

Expand Down Expand Up @@ -466,7 +466,7 @@ function createCron(
(_channel) => _channel == channel
) as TextChannel
notificationChannel
?.send({ content: role, embeds: [embed.setTimestamp()] })
?.send({ content: role || null, embeds: [embed.setTimestamp()] })
.then((msg) => {
setTimeout(function () {
try {
Expand Down

0 comments on commit c4fd8fa

Please sign in to comment.