CactusDev / CactusBot

An open source, community-written service-agnostic chat bot
MIT License
30 stars 5 forks source link

Beam parser #49

Closed 2Cubed closed 8 years ago

2Cubed commented 8 years ago

BeamParser will parse incoming data from Beam to a standard packet format (#43).

pylang commented 8 years ago

Maybe you want an abstract BaseParser that can be subclassed to different services BeamParser, TwitchParser, etc.

2Cubed commented 8 years ago

@pylang Yep, that's the plan! :smile:

2Cubed commented 8 years ago

Currently able to parse most messages, as of 4e19a317a4ba9802634d69e260bebe40ff9ceca7.

Need to decide on how to separate functions that parse incoming packets and outgoing packets, and how to name/call them (similar to on_?).

pylang commented 8 years ago

Why do you need to parse outgoing packets?

2Cubed commented 8 years ago

@pylang We're storing packets in a custom format.

MessagePacket(("text", "Derp! "), ("emote", ":stuck_out_tongue:", ":stuck_out_tongue:"))

The above command, !derp, "was" added by someone using Discord. So, :stuck_out_tongue: was the :stuck_out_tongue: emote, and it was parsed and stored as such.

Now, someone runs !derp on Beam. We need to convert the :stuck_out_tongue: to :P, and then send.

:smile:

2Cubed commented 8 years ago

Finished in a44ce6b73a5db1765af53acccdc9cea8a7a2614a, aside from needing to update the roles with accurate values (#54).