Closed romanzipp closed 7 years ago
The issue with client capabilities is that most of them need to be supported and handled by Cinch itself and can't be dealt with in user code, and enabling the wrong ones could break it. What client capabilities are you trying to enable that do not need to be handled by Cinch itself?
There are some Caps that must be sent to receive specific user details etc. on Twitch IRC. https://github.com/justintv/Twitch-API/blob/master/IRC.md#twitch-capabilities
Okay, looking at that list:
Do you see any problem with enabling twitch.tv/membership and twitch.tv/commands unconditionally in Cinch, and not providing a way for users to specify their own caps?
Would want to see tags support in Cinch. I assume it's part of IRC v3.2? #201
How would you enable twitch.tv/membership? I can't figure out how to set or enable that.
@dominikh you're right, because of the tag cap, you can't access some message methods anymore like message.user
@erichie just edit the cinch sourcecode as mentioned above. You will need to download the cinch repository in order to do that. When installed it with gem
, you could also search for the install path.
As @dominikh mentioned, some methods will break or even the whole script won't run. I haven't had any issues with the twitch capatbilities.
When enabling all caps, you will not have access to several message methods. Here's my example:
on :catchall do |m|
mode = m.raw.scan(/twitch\.tv[\W]([A-Z]{1,})[\W]#/)[0]
case mode
when 'PRIVMSG'
user = m.raw.scan(/@([A-z0-9_]{1,})\./)[0]
message = m.raw.scan(/PRIVMSG #[A-z0-9_]{1,} :(.*)/)[0]
time = m.time
if !Bot.userExcluded(user)
puts "#{time} - <#{user}> #{message}"
end
when 'CLEARCHAT'
user = m.raw.scan(/CLEARCHAT #[A-z0-9_]{1,} :(.*)/)[0]
message = m.raw.scan(/@([A-z0-9_]{1,})\./)[0]
duration = m.raw.scan(/ban-duration=([0-9]{1,});/)[0]
reason = m.raw.scan(/ban-reason=([\w\d\\s,]{1,}) :/)[0]
time = m.time
puts "#{time} - <#{user}> #{message} (#{duration}, #{reason})"
end
end
I was getting in some struggle while connecting to a IRCv3 server where i needed to request custom IRC capabilities.
For this I worked something out:
cinch/configuration/bot.rb: Line 14
cinch/irc.rb: Line 114
Example: