enable pinning of old messages

This commit is contained in:
Lamp 2021-01-22 14:13:50 -08:00
parent e81ad07175
commit af84fb4fe5
2 changed files with 3 additions and 1 deletions

@ -5,7 +5,8 @@ global.Akairo = require("discord-akairo")
global.client = new Akairo.AkairoClient({
ownerID: ["330499035419115522", "707359017252683896"]
},{
disableMentions: "everyone"
disableMentions: "everyone",
partials: ['MESSAGE','REACTION']
})
client.login(process.env.TOKEN).then(() => console.log("ready"))

@ -4,6 +4,7 @@ client.on("messageReactionAdd", async reaction => {
if (reaction.message.channel.id == '802280618636869663') return;
if (reaction.message['has been "pinned"'] || reaction.count > 1) return;
reaction.message['has been "pinned"'] = true;
if (reaction.partial) try { await reaction.fetch() } catch (e) { return }
(await client.channels.fetch('802280618636869663'))?.send(
`https://discord.com/channels/${reaction.message.guild.id}/${reaction.message.channel.id}/${reaction.message.id}`,
new Discord.MessageEmbed()