Cat on the Mountain
Cat on the Mountain
DIAdiscord.js - Imagine an app
Created by Cat on the Mountain on 5/30/2024 in #djs-questions
Editing message
yeah it was still a promise but already had the or something, it's fixed now, thanks
8 replies
DIAdiscord.js - Imagine an app
Created by Cat on the Mountain on 5/30/2024 in #djs-questions
Editing message
but even if the message is loaded it still says that .edit is not a function, i also tried editMessage which i found somewhere else, didn't work either
8 replies
DIAdiscord.js - Imagine an app
Created by Cat on the Mountain on 5/30/2024 in #djs-questions
Editing message
and await just breaks it?
countDownMsg = await client.channels.cache.find(channel => channel.name === 'announcements-‧₊˚✩').send(`# NEXT STAIRCLIMB <t:${nextHourS}:R> #`);
^^^^^

SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1153:20)
at Module._compile (node:internal/modules/cjs/loader:1205:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
countDownMsg = await client.channels.cache.find(channel => channel.name === 'announcements-‧₊˚✩').send(`# NEXT STAIRCLIMB <t:${nextHourS}:R> #`);
^^^^^

SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1153:20)
at Module._compile (node:internal/modules/cjs/loader:1205:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
8 replies
DIAdiscord.js - Imagine an app
Created by Cat on the Mountain on 5/30/2024 in #djs-questions
Editing message
with this being the start of the message object:
Promise {
<ref *1> Message {
channelId: 'xxxxx',
guildId: 'xxxxx',
id: 'xxxx',
createdTimestamp: 1717054848197,
type: 0,
system: false,
content: '# NEXT STAIRCLIMB <t:1717054860:R> #',
author: ClientUser {
Promise {
<ref *1> Message {
channelId: 'xxxxx',
guildId: 'xxxxx',
id: 'xxxx',
createdTimestamp: 1717054848197,
type: 0,
system: false,
content: '# NEXT STAIRCLIMB <t:1717054860:R> #',
author: ClientUser {
8 replies
DIAdiscord.js - Imagine an app
Created by Cat on the Mountain on 5/30/2024 in #djs-questions
Editing message
there is a delay between the send and the edit of 2 seconds, i was also curious if that was the problem so i printed it out and the message was loaded
8 replies