Skip to content

Commit

Permalink
Update application.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWDG authored Nov 8, 2023
1 parent d99590f commit 91395bc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,16 @@ func parseRepo(repo: GitHubRepo) {
// Add the embed array to the discord array.
discordArray["embeds"] = [discordEmbedArray]

let json_data = try? JSONSerialization.data(
withJSONObject: discordArray,
options: []
)
do {
let json_data = try JSONSerialization.data(
withJSONObject: discordArray,
options: []
)
} catch {
print("FAILED TO CREATE JSON")
print(error)
return
}

let url = URL(string: configuration.discord.webhook)!
var request = URLRequest(url: url)
Expand Down Expand Up @@ -286,8 +292,6 @@ func parseRepo(repo: GitHubRepo) {
while (keeprunning) {
// We can not yet exit.
}

dump(discordArray)
}

// WARNING: BAD PRACTICE, I'M FORCING THE PROGRAM TO WAIT FOR THE DATA.
Expand Down

0 comments on commit 91395bc

Please sign in to comment.