Help with Twitch IRC Bot

I’m experimenting with the code given in “Getting Started with Chatbots & IRC” (twitchdevs)
and I’m trying to work with the function ‘onMessageHandler’ to get the user who typed the message it handles. Like for example, on line 34 of that code, I want it to say:

client.say(target, **USERNAME**, You rolled a ${num});

How would I get that information from within the message handler function?

( https://gist.github.com/twitchdevelopers/afda75fe0a43453e97e97b25232778de#file-chatbot_getting_started-js )

Refer to tmi.js documentation to see what gets passed into your event handler. In this case, you would likely want context['display-name'].

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.