Kaiepi / p6-PSBot

Pokémon Showdown chat bot
Artistic License 2.0
0 stars 0 forks source link

PSBot needs a better way of sending responses to messages #21

Closed Kaiepi closed 5 years ago

Kaiepi commented 5 years ago

Lately, I've been implementing stuff that needs to send replies to messages received, such as rules, games, and commands, by returning captures of arguments to pass to PSBot::Connection.send. This is too dependent on what its arguments look like and will be a huge pain in the ass to change if I ever change them again.

I'm thinking of using a PSBot::Response class containing a message and either a user ID or a room ID, along with a Reply subset of PSBot::Response or a List of PSBot::Response. This would never be directly used when writing rules, games, or commands; they'd implement a method that deals with creating the instance for you. The parser would handle the actual sending of the responses.

Kaiepi commented 5 years ago

This was done at some point.