chpsterz
chpsterz
SIASapphire - Imagine a framework
Created by chpsterz on 2/19/2023 in #sapphire-support
How to edit an Embed(Documentation isn't working)
Hi. Trying to make a discord bot that will send a message to a specific channel on startup. I have the message sent to the specific channel on startup, however, when I try to edit it a error is thrown saying message.edit is not a function. I am following the direct steps from the documentation and it is not working. Why and how do I fix this issue?
let message: any;

if(channel?.isTextBased() ) {
message = channel.send({ embeds: [ playerCountEmbedLoading() ] });
}

setInterval(() => {
if(channel?.isTextBased() ) {
return message.edit({ embeds: [ playerCountEmbed() ] })
}
}, 3000)
let message: any;

if(channel?.isTextBased() ) {
message = channel.send({ embeds: [ playerCountEmbedLoading() ] });
}

setInterval(() => {
if(channel?.isTextBased() ) {
return message.edit({ embeds: [ playerCountEmbed() ] })
}
}, 3000)
15 replies
SIASapphire - Imagine a framework
Created by chpsterz on 2/18/2023 in #sapphire-support
"Send" does not exist on type "channel"
Hi. Trying to make a discord bot that will send a message to a specific channel on startup. I try the method of caching the channel and then sending the message. An error is thrown saying "Send" does not exist on type "channel".
const channel = client.channels.cache.get('1076251641625456700');
channel.send("Hi");
const channel = client.channels.cache.get('1076251641625456700');
channel.send("Hi");
Any thoughts why?
38 replies
SIASapphire - Imagine a framework
Created by chpsterz on 2/12/2023 in #sapphire-support
How to defer reply with Sapphirejs
Yes I know, Sapphire doesn't have this feature built-in, so I was wondering how to do it without it?
5 replies