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.
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 aReply
subset ofPSBot::Response
or aList
ofPSBot::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.