#code error

1 messages · Page 1 of 1 (latest)

torpid steeple
#

return await message.channel.send("Je mag niet schelden let op je taal gebruik.").then(msg => {
18.02 20:04:13 [Bot] ^^^^^
18.02 20:04:13 [Bot] SyntaxError: await is only valid in async functions and the top level bodies of modules
18.02 20:04:13 [Bot] at Object.compileFunction (node:vm:352:18)
18.02 20:04:13 [Bot] at wrapSafe (node:internal/modules/cjs/loader:1026:15)
18.02 20:04:13 [Bot] at Module._compile (node:internal/modules/cjs/loader:1061:27)
18.02 20:04:13 [Bot] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
18.02 20:04:13 [Bot] at Module.load (node:internal/modules/cjs/loader:975:32)
18.02 20:04:13 [Bot] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
18.02 20:04:13 [Bot] at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
18.02 20:04:13 [Bot] at node:internal/main/run_main_module:17:47

blazing jungle
#

make function async then

torpid steeple
#

ok

torpid steeple
blazing jungle
#

ofc, async must be function when you using it

#

your messageCreate event must be async

#

async message =>

torpid steeple
#

ok

#

then i is still red

blazing jungle
#

Bruh

#

Really?

#

await your return

#

Not async

#

That's basic js

torpid steeple
#

thx man

torpid steeple
# blazing jungle Bruh

for (let index = 0; index < array.length; index++) {
18.02 20:12:36 [Bot] ^
18.02 20:12:36 [Bot] ReferenceError: array is not defined
18.02 20:12:36 [Bot] at Client.<anonymous> (/index.js:66:37)
18.02 20:12:36 [Bot] at Client.emit (node:events:402:35)
18.02 20:12:36 [Bot] at MessageCreateAction.handle (/node_modules/discord.js/src/client/actions/MessageCreate.js:26:14)
18.02 20:12:36 [Bot] at Object.module.exports [as MESSAGE_CREATE] (/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
18.02 20:12:36 [Bot] at WebSocketManager.handlePacket (/node_modules/discord.js/src/client/websocket/WebSocketManager.js:351:31)
18.02 20:12:36 [Bot] at WebSocketShard.onPacket (/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
18.02 20:12:36 [Bot] at WebSocketShard.onMessage (/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
18.02 20:12:36 [Bot] at WebSocket.onMessage (/node_modules/ws/lib/event-target.js:199:18)
18.02 20:12:36 [Bot] at WebSocket.emit (node:events:390:28)
18.02 20:12:36 [Bot] at Receiver.receiverOnMessage (/node_modules/ws/lib/websocket.js:1137:20)
18.02 20:12:36 [Bot] Node.js v17.3.1

#

when i say fuck it dont delete the msg and it gives a error

blazing jungle
#

Define ot then

#

What is array?

torpid steeple
#

i send the file

blazing jungle
#

Doesn't change my answer

torpid steeple
torpid steeple
blazing jungle
#

And inside your for you are creating SwearWord which is part of SwerWords but it is never used

torpid steeple
#

oke

blazing jungle
#

And

#

Inside for loop options change array to SwearWords

torpid steeple
#

wich line is that