/discordrb-cpp

Re-implementing various aspects of discordrb as a native ruby extension.

Primary LanguageC++MIT LicenseMIT

Discordrb CPP

An extremely unnecessary proof of concept.

This is an implementation of a Discord gateway using websocketpp, and tightly integrated with Ruby native extensions. It is intended to serve as somewhat of a drop in replacement for discordrb's gateway.

More than anything this is a proof of concept, and holds little to no real world advantage over the existing websocket implementation. However, it does show improved parsing times, and has thus far not shown to have the same bugs as the ruby implementation (which is good, because heartbeat events are not raised, making health checks tricky).

Building

You must have websocketpp, libstdc++, boost, boost_iostreams, boost_system, and zlib libraries installed to properly run the extension.

You can generate the makefile with

ruby extconf.rb

And then you can build with

make

Any warnings about command line options can be ignored, as they are results of invalid options in the rice-mkmf generator.


Usage

To start using the extension you should follow example.rb in the top directory. Since not all features are implemented, the Bot class needs to be patched to remove usage of unimplemented methods.

Thanks

Many thanks to zeroxs whose C++ library enabled me to figure out certain aspects when I was clueless.