Giter VIP home page Giter VIP logo

Comments (6)

gaiterjones avatar gaiterjones commented on August 21, 2024 1

OK, well twitch IRC certainly doesn't use any standard colour codes as documented in other irc server/clients.

I found this https://dev.twitch.tv/docs/irc

and tried something like this

$this->send_text_to_server('bot', '@color=#0D4200 PRIVMSG ' . $channel . ' :' . $message);

But it doesn't seem to do anything...

from twitch-chat-bot-php.

gaiterjones avatar gaiterjones commented on August 21, 2024 1

Will do, I will close this now!

from twitch-chat-bot-php.

ilias-sp avatar ilias-sp commented on August 21, 2024

hi!

unfortunately no, i haven't spent any time towards that direction. i did some sniffing now to a channel, and here are my findings:

  • font color: you can add the "/me" prefix to the message. The nightbot is doing it somehow differently, i could see in the log some "binary" chars, displayed with ^A below:

:[email protected] PRIVMSG #streamer_channel :Sogomn -> The command "!score" has been edited successfully.

:[email protected] PRIVMSG #streamer_channel :^AACTION hugs Sogomn^A

:[email protected] PRIVMSG #streamer_channel :^AACTION pushes sogom away^A

:[email protected] PRIVMSG #streamer_channel :BacT's worst nightmare

  • Background color, you mean the message sent out from Twitch about new sub notification? the only message i captured from the bot is a USERNOTICE message:

:tmi.twitch.tv USERNOTICE #streamer_channel :I wanted to sub to Daut, don't know what happened

the rest of the message (username subbed for X months) doesnt appear captured, i guess its not sent via IRC?

hope these help!

from twitch-chat-bot-php.

ilias-sp avatar ilias-sp commented on August 21, 2024

yes, i read the link you provided, and seems these are IRC v3 tags, and require "elevation" during initial connect.

CAP REQ :twitch.tv/tags

i added this command to the _login_to_twitch() function, i made a few attempts with the provided example for PRVMSG scenario, but didn't succeed to see it working. tag syntax you provided seems correct, but probably need to populate more fields. if you want to inspect further, modify login_to_twitch function:

$this->send_text_to_server('service', 'PASS ' . $this->oath_pass);
usleep(1000000);
$this->send_text_to_server('service', 'NICK ' . $this->nickname);
usleep(1000000);
$this->send_text_to_server('service', 'CAP REQ :twitch.tv/membership');
usleep(1000000);
$this->send_text_to_server('service', 'CAP REQ :twitch.tv/commands');
usleep(1000000);
$this->send_text_to_server('service', 'CAP REQ :twitch.tv/tags');
usleep(1000000);
$this->send_text_to_server('service', 'JOIN ' . $this->channel);
$this->logger->log_it('INFO', CLASS, FUNCTION, 'Login commands were sent. Bot is ready.');
//
return TRUE;

open the logs and you will see examples of the command syntax

hope it helps, please ping if you get any luck with it !

from twitch-chat-bot-php.

gaiterjones avatar gaiterjones commented on August 21, 2024

Well this is frightfully frustrating. I guess it is not possible to set the IRCv3 tags from the client.

I tried this for example:
$this->send_text_to_server('bot', '@badges=moderator/1;color=#FF0000;display-name=mybot;emote-sets=0;mod=1;subscriber=0;user-type=mod;user-type= :[email protected] PRIVMSG ' . $channel . ' :' . $message);

But then I see no response at all. The closest I have come is:

$this->send_text_to_server('bot', 'PRIVMSG ' . $channel . ' :/color red');
$this->send_text_to_server('bot', 'PRIVMSG ' . $channel . ' :/me ' . $message);

Which changes the client (bot) colour and then uses /me as you first suggested - but it's a pretty stoopid way of doing it if you ask me...

from twitch-chat-bot-php.

ilias-sp avatar ilias-sp commented on August 21, 2024

from twitch-chat-bot-php.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.