Skip to content

Commit

Permalink
Merge pull request #65 from BluLightShow/develop
Browse files Browse the repository at this point in the history
hotfix: bump versions for crosspost support
  • Loading branch information
max-bromberg authored Jan 20, 2021
2 parents 5e96b73 + d71bfea commit a29827a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 56 deletions.
42 changes: 22 additions & 20 deletions listeners/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class MessageListener extends Listener {
// File filter
if (message.attachments.find(attachment => {
const allowedExtensions = ['png', 'jpg', 'gif', 'webp', 'tiff', 'heif', 'jpeg', 'svg', 'webm', 'mpg', 'mpeg', 'ogg', 'mp4', 'm4v', 'avi', 'mov', 'm4a', 'mp3', 'wav', 'pdf']
const extension = attachment.name.split('.').pop().toLowerCase()
return (!allowedExtensions.includes(extension)) && (!message.member.roles.cache.find(role => role.id === '451152561735467018'))
const extension = attachment.name.split('.').pop().toLowerCase()
return (!allowedExtensions.includes(extension)) && (!message.member.roles.cache.find(role => role.id === '451152561735467018'))
})) {
message.delete().then(() => {
message.channel.send(
Expand Down Expand Up @@ -44,35 +44,37 @@ class MessageListener extends Listener {
message.guild.channels.resolve(linkArray[1]).messages.fetch(linkArray[2]).then(msg => {
message.channel.send(
new MessageEmbed(embed)
.setTitle(msg.content)
.setAuthor(msg.author.tag + ' said:', msg.author.avatarURL({ dynamic: true }))
.setFooter(`Message link sent by ${message.author.tag}, click original for context.`)
.setTitle(msg.content)
.setAuthor(msg.author.tag + ' said:', msg.author.avatarURL({ dynamic: true }))
.setFooter(`Message link sent by ${message.author.tag}, click original for context.`)
)
}).catch(err => {
console.error(err)
})
}
})
}

// Auto-crosspost feed channels
if ((message.channel.id === '610239559376044043') || (message.channel.id === '610239597317849248') || (message.channel.id === '610253712824467473')) {
var crosspostLog = message.guild.channels.resolve('801316586371416074')
message.crosspost().then(() => {
crosspostLog.send(
new MessageEmbed(embed)
.setTimestamp(new Date())
.setTitle(`Successfully auto-crossposted in #${message.channel.name}`)
if (message.crosspostable) {
message.crosspost().then(() => {
crosspostLog.send(
new MessageEmbed(embed)
.setTimestamp(new Date())
.setTitle(`Successfully auto-crossposted in #${message.channel.name}`)
)
}).catch(err => {
console.error(err)
crosspostLog.send(
new MessageEmbed(embed)
.setTimestamp(new Date())
.setTitle(`Failed to auto-crosspost in #${message.channel.name}`)
.setDescription('This is likely due to ratelimiting. Check production logs for more information.')
)
})
}).catch(err => {
console.error(err)
crosspostLog.send(
new MessageEmbed(embed)
.setTimestamp(new Date())
.setTitle(`Failed to auto-crosspost in #${message.channel.name}`)
.setDescription('This is likely due to ratelimiting. Check production logs for more information.')
)
})
}
}
}
}
Expand Down
66 changes: 33 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "arduino-bot",
"version": "v0.1.1",
"version": "v0.1.2",
"description": "A bot to help the arduino community!",
"main": "bot.js",
"dependencies": {
"discord-akairo": "^8.0.0",
"discord.js": "^12.2.0",
"discord-akairo": "^8.1.0",
"discord.js": "^12.5.1",
"gists": "^2.0.0"
},
"scripts": {
Expand Down

0 comments on commit a29827a

Please sign in to comment.