You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
channel.messages.fetch().then((messages) => {
if (messages.size === 0) {
// Send a new message
channel.send(text).then((message) => {
addReactions(message, reactions)
})
} else {
// Edit the existing message
for (const message of messages) {
message[1].edit(text)
addReactions(message[1], reactions)
}
}
})
}
Microsoft Windows [version 10.0.18363.1198]
(c) 2019 Microsoft Corporation. Tous droits réservés.
C:\Users\young\OneDrive\Bureau\Bot KGB>node index.js
(node:3948) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'messages' of null
at module.exports (C:\Users\young\OneDrive\Bureau\Bot KGB\first-message.js:12:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:3948) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node
process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3948) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Le Bot est prêt
The text was updated successfully, but these errors were encountered:
Hello I have a error message in the terminal and I whould like to have some help please I tried everything but I can't find where ;/
Here is the code
const addReactions = (message, reactions) => {
message.react(reactions[0])
reactions.shift()
if (reactions.length > 0) {
setTimeout(() => addReactions(message, reactions), 750)
}
}
module.exports = async (client, id, text, reactions = []) => {
const channel = await client.channels.fetch(id)
channel.messages.fetch().then((messages) => {
if (messages.size === 0) {
// Send a new message
channel.send(text).then((message) => {
addReactions(message, reactions)
})
} else {
// Edit the existing message
for (const message of messages) {
message[1].edit(text)
addReactions(message[1], reactions)
}
}
})
}
Microsoft Windows [version 10.0.18363.1198]
(c) 2019 Microsoft Corporation. Tous droits réservés.
C:\Users\young\OneDrive\Bureau\Bot KGB>node index.js
(node:3948) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'messages' of null
at module.exports (C:\Users\young\OneDrive\Bureau\Bot KGB\first-message.js:12:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:3948) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node
process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)(node:3948) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Le Bot est prêt
The text was updated successfully, but these errors were encountered: