enable pinning of old messages
This commit is contained in:
parent
e81ad07175
commit
af84fb4fe5
3
main.js
3
main.js
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user