Open MatthewBaggins opened 1 year ago
I know this is an old post, but I'm not sure this is necessary. The why module is meant to debug responses when Stampy is prompted by a user. Automatic posts, such as the one in this screenshot, are not prompted, Stampy was just designed to post them. Any Stampy Dev should be familiar with what modules automatically post things like that.
Normally, Stampy sends messages to channels using the
Response
object. Passing a string to thewhy
argument gives us a way to ask Stampy for why he gave particular responsesHowever, sometimes Stampy sends a message to a channel as a string via
await channel.send
syntax. This allows Stampy send a message to an arbitrary channel, rather than just "inResponse
" to a message that somebody else posted to the channel. However, in this case there is nowhy
because there is noResponse
.Giving "reasons why" is served by the
Why
module.Maybe it would be possible to use
Response
withawait channel.send
but IDK. One alternative I see is just to make Stampy remember all the awaited messages he sends, e.g., by saving them to some new dictionary inUtilities
that maps message IDs to their "why's". In this case, we would probably want to have a new method for doingawait channel.send
, which automatically saves the messages to that dictionary. TheWhy
module would then need to be extended to make use of that dictionary.