shuppet / raku-api-discord

Raku module for interacting with the Discord API.
https://shuppet.com
BSD 3-Clause "New" or "Revised" License
30 stars 3 forks source link

Problems after updating to latest Perl6/Rakudo #18

Closed throwaway-30964 closed 5 years ago

throwaway-30964 commented 5 years ago

I built P6 from the master using this script:

cd ~/source/rakudo && git checkout master && git pull &&\n git checkout $(git describe --abbrev=0 --tags) &&\n perl Configure.pl --gen-moar --gen-nqp --backends=moar &&\n make && make install

(Sadly I don't know when I did that last time, but it was definitely also 2018.12 built from master.) After that, my bot that worked fine before starting throwing some errors on startup:

5 (/home/throwaway/source/discord/bot.p6 line 9)
my $api = API::Discord.new(:$token)
6 (/home/throwaway/source/discord/bot.p6 line 11)
await $api.connect
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in block  at /home/throwaway/source/discord/../p6/p6-api-discord/lib/API/Discord/Connection.pm6 (API::Discord::Connection) line 146
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in method handle-message at /home/throwaway/source/discord/../p6/p6-api-discord/lib/API/Discord.pm6 (API::Discord) line 184
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in block  at /home/throwaway/source/discord/../p6/p6-api-discord/lib/API/Discord.pm6 (API::Discord) line 172

Also API::Discord.messages does not trigger anymore, no matter what's happening in the chat. Other things like .trigger-typing still seem to work, although those are triggered by a timer, not as reaction to some discord event. The whole bot can be found here: https://github.com/throwaway-30964/infinite-garbage/blob/master/bot.p6 (it basically takes an input file with text and generates random messages based on it.) Interestingly the basic example from the README (https://github.com/shuppet/p6-api-discord/blob/master/examples/echo-server.p6) seems to work just fine, so maybe some of the other things in the script might cause the problems, although I don't see how and it worked before the update, so maybe a bug in rakudo itself?

throwaway-30964 commented 5 years ago

Sorry for bothering you, it was some local glitch. I had used -I <path to my local clone of API::DIscord on the command line. Even though it was a fresh checkout of the repo and didn't have local changes, that somehow blew it (maybe cached compiled code or something). Installing the module with zef install . and running the bot without the -I flag fixed the problem.