#code help
1 messages · Page 1 of 1 (latest)
Bruh why did you make a thread
client.on("messageCreate", msg => {
if(msg.author.bot)
return
else {
if(msg.channel.type != "DM"){
if (msg.content === dm_prefix + " " + "ping") {
msg.reply("pong");
}
}
else {
if (msg.content == dm_prefix + " " + "help") {
const exampleEmbed = new MessageEmbed()
.setTitle('DM help')
.addField(':desktop: Server Suggestions', `${dm_prefix} suggest`, false)
.addField(':robot: Bot Suggestions', `${dm_prefix} improve`, false)
.addField(':grey_question: Anonymous Question', `${dm_prefix} ask`, false)
msg.channel.send({ embeds: [exampleEmbed] });
}
else if(msg.content.startsWith(`${dm_prefix} suggest`)){
(await msg.client.channels.fetch(channel_id)).send(msg.content)
}
else {
msg.author.send(`The DM prefix is -> \`${dm_prefix}\` \nTry typing \`${dm_prefix} help\` `)
}
}
}
})
thought pasting the whole code will be like spamming
ur doing await in an non-async
how do i do it without await
by removing await
msg.client.channels.fetch(channel_id).send(msg.content)
^
TypeError: msg.client.channels.fetch(...).send is not a function
try client.channels.cache.get(channel_id)
ok