nust
December 29, 2020, 4:13pm
1
Hello,
Today i’m trying to make something for my Twitch channel and I need to get the username of the viewers who sub and then display it in a message.
I tried to find out on the documentation how to do it, but after many hours, I can’t.
Any insight you can provide I would greatly appreciate.
N.
You can get a “new or returning subscriber” in real time via
nust
December 29, 2020, 10:44pm
3
I’m really sorry, but I have been trying for hours now, and i still can do it.
Is that possible that you write me the code so I can better understand ?
Sorry, but thanking you in advance,
What do you currently have that isn’t working.
Are you trying to use chat, pubsub or webhooks?
nust
December 29, 2020, 10:50pm
5
I’m trying to check when someone subs
client.on(“subscription”, (channel, username, method, message, userstate) => {
if (self) { return; }
whisperSomeone(username);
and I want to get something like this that i can use in an other part of the code :
${username}
By the way, i am really sorry if it’s confusing, i’m new in development and i try things
Ah that looks like you are trying to use tmi.js
And then trying to whisper them
TLDR, don’t bother. Bots cannot whisper (generally speaking).
You’ll get stuck in the spam black box of doom and not be able to send whispers. Whispers are not intended to be used by bots. It’s been ruined by spammers
nust
December 29, 2020, 10:53pm
7
Oh no that was not what i was trying. I thought whisper meant using the name as a general thing that can be re-used. What i intended to do, is to quote them in the chat. I mean, caught their nickname and display into chat.
According to the docs your code appears correct.
But I don’t use tmi.js
---
layout: post
title: "Events"
date: 2019-03-03 00:00:00 -0400
categories: v1.4.2
---
# Events
Some events will only be fired if you are logged in. If you are not familiar with event listeners, please [read this](https://nodejs.org/api/events.html).
## Contents
- [Action](#action) - Received action message on channel.
- [Anongiftpaidupgrade](#anongiftpaidupgrade) - Username is continuing the Gift Sub they got from an anonymous user in channel.
- [Ban](#ban) - Username has been banned on a channel.
- [Chat](#chat) - Received message on channel.
- [Cheer](#cheer) - Username has cheered to a channel.
- [Clearchat](#clearchat) - Chat of a channel got cleared.
- [Connected](#connected) - Connected to server.
- [Connecting](#connecting) - Connecting to a server.
This file has been truncated. show original
nust
December 29, 2020, 10:59pm
9
Would you recommand me to try with chat to do it easier?
And is there a simple way to do it?
if you intent is to @ the user who is sunscribeing then chat is the way to go. I just never use a library to talk to chat.
system
Closed
January 28, 2021, 11:00pm
11
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.