mirror of
https://github.com/JonasunderscoreJones/PinBoardBot.git
synced 2025-10-22 17:59:17 +02:00
Fixed issue with duplicate pin message
and removed debug code that was accidentally left in
This commit is contained in:
parent
afaece95cc
commit
6f24f9be97
1 changed files with 22 additions and 25 deletions
27
src/index.js
27
src/index.js
|
@ -37,18 +37,6 @@ client.on("messageCreate", message => {
|
|||
|
||||
try {
|
||||
|
||||
client.channels.fetch(pinchannelid).then(channel=>channel.send(msgtobepinned.url + "\n" + msgtobepinned.content)).then(msg => {
|
||||
|
||||
logger(message.author.tag + " pinned " + msgtobepinned.content);
|
||||
|
||||
// client.channels.resolveId(pingchannelid).then(pingchannel => {
|
||||
|
||||
// message.pingchannel.send("Pinned message: " + msgtobepinned.content);
|
||||
// }),
|
||||
|
||||
|
||||
message.reply("Message pinned!");
|
||||
msgtime = new Date();
|
||||
|
||||
// inside a command, event listener, etc.
|
||||
const exampleEmbed = new MessageEmbed()
|
||||
|
@ -66,11 +54,20 @@ client.on("messageCreate", message => {
|
|||
.setTimestamp()
|
||||
.setFooter('A bot by Jonas_Jones @ https://github.com/J-onasJones/PinBoardBot/','https://cdn.discordapp.com/avatars/627930249811984441/5c5ce5730995ef801f163e3625928f35.webp');
|
||||
|
||||
message.channel.send({ embeds: [exampleEmbed] });
|
||||
client.channels.fetch(pinchannelid).then(channel=>channel.send({ embeds: [exampleEmbed] }).then(msg => {
|
||||
|
||||
message.channel.send(msgtobepinned.author.displayAvatarURL());
|
||||
logger(message.author.tag + " pinned " + msgtobepinned.content);
|
||||
|
||||
});
|
||||
// client.channels.resolveId(pingchannelid).then(pingchannel => {
|
||||
|
||||
// message.pingchannel.send("Pinned message: " + msgtobepinned.content);
|
||||
// }),
|
||||
|
||||
|
||||
message.reply("Message pinned!");
|
||||
msgtime = new Date();
|
||||
|
||||
}));
|
||||
|
||||
} catch (errormsg) {
|
||||
logger(message.author.tag + " tried to pin but error occured: " + errormsg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue