Skip to content
This repository was archived by the owner on Feb 4, 2021. It is now read-only.
This repository was archived by the owner on Feb 4, 2021. It is now read-only.

Use gateway ID mapper to override opcodes #2

@n7st

Description

@n7st

There is a gateway code -> name mapper in Discord::Roles::Gateways (->gateway_errors) which should be used to override the opcodes in Discord::Client for readability (and so they can be overridden in custom user classes).

Presently, opcodes are checked like so (Discord::Client::connect()):

$self->hello($content)  if $content->{op} == 10;
$self->resume($content) if $content->{op} == 7;

However, in a custom override, it would be nice to set 'Hello' => 'my_hello_subroutine'.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions