X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Bot.pm;h=9bf39f9ae09c612b88bdca9100558b1a4f505955;hp=89ec47d7c1e75ae9d7c3cb397b07e0b92b6a2026;hb=036bfadee395d5ec8bfa4e00b05077a90a8d232a;hpb=0822847cd53af14ada68762a2f9d152a274a4d9b diff --git a/Bot.pm b/Bot.pm index 89ec47d..9bf39f9 100644 --- a/Bot.pm +++ b/Bot.pm @@ -61,6 +61,12 @@ has discord_id => ( isa => 'Str' ); +has discord_channels => ( + is => 'rw', + isa => 'HashRef', + default => sub { {} } +); + # We registered for all events, this will produce some debug info. sub _default { my ($event, $args) = @_[ARG0 .. $#_]; @@ -329,6 +335,13 @@ sub discord_message_create { } sub discord_guild_create { + my $self = shift; + my $hash = shift; + + for my $chan (@{$hash->{channels}}) { + say localtime(time) . "$chan->{id} - $chan->{name}"; + $self->discord_channels->{$chan->{id}} = $chan->{name}; + } } sub parseCommand {