Skip to content

Commit

Permalink
feat: use pusher instead of latest author
Browse files Browse the repository at this point in the history
  • Loading branch information
ChatDisabled committed Dec 6, 2023
1 parent da09288 commit 65664cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/discord.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { MessageEmbed, WebhookClient } = require('discord.js')
const MAX_MESSAGE_LENGTH = 72

module.exports.send = (id, token, repo, url, commits, size) =>
module.exports.send = (id, token, repo, url, commits, size, pusher) =>
new Promise((resolve, reject) => {
let client
const username = repo.replace(/(discord)/gi, '******')
Expand All @@ -14,7 +14,7 @@ module.exports.send = (id, token, repo, url, commits, size) =>
client
.send({
username: username,
embeds: [createEmbed(url, commits, size)],
embeds: [createEmbed(url, commits, size, pusher)],
})
.then(() => {
console.log('Successfully sent the message!')
Expand All @@ -27,7 +27,7 @@ module.exports.send = (id, token, repo, url, commits, size) =>
}
})

function createEmbed(url, commits, size) {
function createEmbed(url, commits, size, pusher) {
console.log('Constructing Embed...')
console.log('Commits :')
console.log(commits)
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async function run() {
payload.compare,
commits,
size,
payload.pusher.name
)
.catch((err) => core.setFailed(err.message))
}
Expand Down

0 comments on commit 65664cb

Please sign in to comment.