GithubHelp home page GithubHelp logo

mtwitch's Introduction

mTwitch

mTwitch is a modulizer set of scripts for mIRC to help conform twitch more closely to the IRC standard and to make twitch more accessible from within the mIRC enviornment. More information about what each module does can be found on the wiki.

If you appreciate the work done, consider donating via StreamJar

Rights and Distributing

You may do with the code as you wish so long as you do not redistrubute any files contained with in this repository, in part or whole, without direct permission from me. You may directly link to any asset within this repository so long as you also include a link to the top level of the repository.

SReject Β© 2016; All rights reserved.

Requirements and Dependencies

  • mIRC v7.43
  • Windows XP+: Due to a dependency in the JSON parser these scripts will not work under WINE
  • JSONForMirc.mrc: Many of scripts take advantage of twitch's webapi including mTwitch.Core.mrc
  • mTwitch.core.mrc is required by all other scripts in the repo

Installation

  1. Download the script(s) you wish to load
  2. Move script(s) to a folder of your choosing
  3. From within mIRC hold the alt key and press r; release both
  4. Click File then Load
  5. Navigate to the folder in which you moved the script(s) to.
  6. Select the script(s) and then click Open
  7. Click OK
  8. If a box pops up asking if you wish to run initialization commands, click OK

Help Needed

If you would like to help simply clone the repo, make updates and make a pull request. If applicatable your request will be merged with the master branch. Help is needed for adding features, commenting/cleaning up code and wiki documentation.

Contact

If you wish to contact the authors or get involved in the discussions join #mirchelp's stream chat.

mtwitch's People

Contributors

racingpro avatar sreject avatar travis-britz avatar westor7 avatar zeccax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtwitch's Issues

Whisper handling

I recently looked over your parseline on how you get the whispers that are directed to the bot. Though I am quite curious if you have any ideas or examples as to how the bot would respond to that whisper.

The goal I am working towards is that if someone whispers a command !birthday for instance. To the bot that it would react the same as if the user whispered it in the channel.

Thank you sincerely for your time and your effort on this.

Resub messages don't show

Trying to figure out why sub and resub messages dont show at all. It shows who subs and how long but doesnt seem to show what they say. I can see it in the user notices in the status window but it wont add it in the channel
I couldnt get it to work myself by editing the mtwitch.core.mrc

Twitch API v5 timestamps and displayname

Yes, v3 will continue to work until 2018 but they still recommend people to migrate whenever possible.

Specifically these changes I've noticed so far affect mTwitch.

  • The new version of the API uses user IDs instead of user names to reference users.
  • Sub-second precision was added to time fields

alias mTwitch.ConvertTime
This is going to have to accept the new timestamps.

mTwitch.DisplayName.mrc
This request is no longer going to work because it will expect a user ID:
https://api.twitch.tv/kraken/users/ $+ $mTwitch.UrlEncode($me)

API documentation: Translating from User Names to User IDs
Actually, it also returns display_name (as shown in the example) so we're not gonna need to make another request πŸ‘ Live sample data

So I guess it would look something like this:

JSONOpen -uw mTwitch_NameFix https://api.twitch.tv/kraken/users?login= $+ $mTwitch.UrlEncode($me)
JSONHttpHeader mTwitch_NameFix Client-ID gjiaolylvp6t7gukddfzee9ehets66w
JSONHttpHeader mTwitch_NameFix Accept application/vnd.twitchtv.v5

I would submit a pull request if I knew how to handle the output.

(I'm sure mTwitch.StateToTopic.mrc is going to need a lot of work, but I'm not using that myself)

Thanks for the excellent work with this script!

mTwitch.GroupChat.mrc can't connect to group chat

Hi. I just restarted my mIRC bot and got this message:

[mTwitch->GroupChat] Connection to Twitch Group-Chat server lost; attempting to reconnect...

I noticed the script has been updated 9 days ago and updated it, but I still get the message above.

StateToTopic allows for arbitrary code execution

Having the | character in the title of a stream (and I'd assume game as well) makes mirc parse the rest of the title as a new line, allowing for someone to possibly execute code. I tested for fun on another network not utilizing your script, and as expected it was not parsed as a new line.

I don't know if there's an easy way to fix this, as I'm way below this level of scripting, but replacing that in the original %title grabber with $chr(166) proved to work quite well for me.

actual title
mirc title via StateToTopic
attempted "code" execution

Alt. DisplayName script to remove localized names

I'm wondering if you can create an alternative version of mTwitch.DisplayName.mrc that removes localized names for people that want that? Or maybe make it an option somehow?

The problem I have is that if I use the mIRC script, it will only show the localized name, since that is the display name.

On Twitch it normally shows both the localized name and the username, and a lot of people (including myself) also use BTTV to completely remove the localized name.

The problem with having only the localized name, for me at least, is that it makes it really difficult to moderate a channel with lots of Korean chatters, because I can't type out their name, or tab-complete it.

Here's an example: λΉ„μ„œ91 (bsuh91)
Here's his Twitch API
Here's his parseline:
@badges=premium/1;color=#1E90FF;display-name=λΉ„μ„œ91;emotes=;id=83baf952-c9b7-4323-844a-91d62a6cec95;mod=0;room-id=36625500;sent-ts=1496084548967;subscriber=0;tmi-sent-ts=1496084549486;turbo=0;user-id=90456573;user-type= :[email protected] PRIVMSG #rebebbiz :test

BetterTTV can just replace the name with what's inside the brackets, so that's easy for them. But for IRC we probably need to test the display name for non-alphanumeric characters.

That above parseline would normally look like this: <λΉ„μ„œ91> test
But I think I fixed it now to this: <bsuh91> test

I changed the code to this, and it works fine for me:

  if ($mTwitch.isServer) {
    %dnick = $remove($mTwitch.MsgTags(%tags, display-name), $chr(32), $cr, $lf)
    if ($regex(%dnick,/\W/)) {
      .parseline -it %tags $+(:, %nick, %param)
    }
    elseif (%dnick !== $null && %dnick !=== %nick) {
      .parseline -it %tags $+(:, %dnick, %param)
    }
  }

I figured if %dnick is empty it will return 0 anyway, so there's no need for other checks than the regex for localized check.

I removed that user-name= insertion just to make it easier to read. But maybe you'd also want to add a localized-name= thing or something?

I'm sure more people would be happy with a change like this, so I thought I'd share :)

Localized Display Names are Blank

Using mTwitch.Core.mrc and mTwitch.DisplayName.mrc. Users with a Twitch "localized display name" are not being recognized. mIRC simply returns their name as nothing.

Display Names No Longer Work

Using the very latest mTwitch.Core.mrc (0000.0000.0011) and mTwitch.DisplayName.mrc (0000.0000.0003). Twitch display names no longer work at all for me. My bot replies with all lowercase usernames now.

mTwitch.StateToTopic is not working

I updated jsonformirc, mtwitch.core and mtwitch.statetotopic but the channels are always offline. Am i missing something on the new version of mtwitch?

Empty display-name

People that don't have a display name set will be named $true when using mTwitch.DisplayName.mrc

PARSELINE:
@badges=premium/1;color=#008000;display-name=;emotes=25:72-76;id=dd165c3b-64c6-4d7d-97bf-0d6f88bdf28b;mod=0;room-id=36625500;sent-ts=1487525560768;subscriber=0;tmi-sent-ts=1487525560386;turbo=0;user-id=32161641;user-type= :[email protected] PRIVMSG #rebebbiz :theres a secret ending btw

Chat:
<$true> theres a secret ending btw

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.