can we add a string to the command content response by PreMessageContentRun ?
Like i have in my messageRun command file:
message.channel.send(‘hi’)
In the event file, i use like:
payload.messageContent += ‘ everyone’ then bot’ll send to channel: hi everyone
3 Replies
There is no event called PreMessageContentRun nor will there ever be for it would mean editing the prototype function of the Message and overriding the function. If you want to add the same string a lot of times just store it as s constant and use template tags to insert it or wrap your string in a function to do the same.
So sorry, i mean PreMessageCommandRun
I just want a global listener to do all of that
Well sapphire doesn't support that nor will we because it promotes bad code quality and bad practises. You'll have to write your own code for this, as I'll advised as it is.