Answer the question
In order to leave comments, you need to log in
Why can't the Discord bot find the message?
Good day,
my problem is that I added my code and it stopped working, later I changed it completely,
but it still didn’t want to work.
db.get() - get data from local file
db.set() - replace data in file
Msg - variable storing data in JSON format
Initially, working code looked like this:
var tokens = message.content.split(" ");
const MTid = tokens[1];
if (MTid == null || MTid == undefined) return message.author.send("Будьте добры указать ID сообщения, которого вы пытаетесь изменить.");
else if (db.get(MTid)) {
const Msg = db.get(MTid);
const RID = parseInt(MTid, 10);
async function EditMessage() {
let someserver = client.guilds.cache.get('686225794766209088');
let somechannel = someserver.channels.cache.get(Msg.channelid);
let somemessage = await somechannel.messages.fetch(Msg.realid);
.
.
.
}
EditMessage();
var tokens = message.content.split(" ");
const MTid = tokens[1];
if (MTid == null || MTid == undefined) return message.author.send("Будьте добры указать ID сообщения, которого вы пытаетесь изменить.");
else if (db.get(MTid)) {
const Msg = db.get(MTid);
const RID = parseInt(MTid, 10);
async function EditBugMessage() {
let someserver = client.guilds.cache.get('686225794766209088');
let somechannel = someserver.channels.cache.get(Msg.channelid);
await somechannel.messages.fetch(Msg.realid).then(somemessage => {
.
.
.
});
await somechannel.messages.fetch(Msg.realid);
Answer the question
In order to leave comments, you need to log in
I don’t know why, but the whole construction decided to work, probably this is due to recent updates to the discord.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question