Trouble Getting Bot to Delete Discord Messages

discord

#1

Phantom Bot Version: 2.3.9

Tried using: !moderation cleanup <#channelid> amountoflines
Using “!moderation cleanup channelname amountoflines” resulted in a snowflake error from discord api with the message {“before”: [“snowflake value should be less than or equal to 9223372036854775807.”]} I’m assuming that discord api will only take in the text-channel’s ID which has an upper bound of 9223372036854775807.
Bot responded to @me and say (amountoflines) has been deleted (but nothing happened).

Looked into DiscordUtil to try my luck at making another command to delete the messages.

Typical errors I received were because I did not properly cast an object into the method:
bulkDeleteMessages takes a channel string or channel object, and an array of message objects (not exactly sure how to send a message object to the function).

bulkDelete returned no errors (it already has a method to take care of channel strings and channel objects, the second value inputted into the function was a simple integer).

I’m unsure what getMessageHistory or getMessage returns inside the discordUtil and am curious to see if these might be the roots of the problem.


#2

Last I recall this was an issue with the discord library they use… I think it was fixed in a nightly build.

You might be fine if you Download the nightly (clicking the text will download it)

and extract the libs into your existing bot. (Make a backup of your current libs just in case)

Worse comes to worse you could upgrade to the nightly and use that.


#3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.