Should my bot sending out dm's trigger it's own messageCreate event?
All of a sudden my bot is registering it's own messages as events
12 Replies
Are you using sapphire or your own command framework?
Sapphire
sapphire should ignore bots
by default
Alright, let me share code
I'm curious on what this code is supposed to do
also no, then sapphire won't ignore bots because you're using your own listener
you're literally listening to message events, as emitted by djs and NOT sapphire
so without the preprocesssing of sapphire yeah you will get bot messages because your code doesn't filter them
also the
message = await message.fetch()
is odd
you can just do if partial { await message.fetch() }
nonetheless, weird implementation. What is your goal with this code?I cut out all the actual implementation, it's meant to forward the bot's dm's to log channels, but I cut all that out
forward bot dms to log channels?
š¬
there's an event that you can listen to instead of messageCreate that can run after sapphire parses it
so you get the benefit of partial-free and bot-free message
Would love that, is it in the guide? I thought the standard djs events were already pre-parsed
![No description](https://utfs.io/f/945ebbe5-9f0b-41fe-bdf8-ce76442b76dd-1nq2cb.png)
sapphire does not modify any djs event
it merely builds on top of them
PreMessageCommandRun
seems like the one you want
or PrefixedMessage
the latter more useful
I also suggest removing your MessageManager
static class to be inlined into the listener because the manager class does nothing more than some reactions it looks