dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.3.1 | You're being logged at https://irclog.whitequark.org/cinch/
_whitelogger has joined #cinch
Azure|dc has joined #cinch
Azure has quit [Ping timeout: 260 seconds]
StockBot has joined #cinch
<StockBot> Hey, Im trying to find a way to on :message, /^!notice (.+) do |m,term| and then have cinchbot notice the channel but I only want an Op to be able to perform this task... or other times where it may be an automated notice
<StockBot> i can send to the channel normally, but im looking for the notice, where it sets off alerts/highlights
<StockBot> Any help would be greatly appreciated
<StockBot> Ok i figured out the notice part - m.channel.notice("#{term}")
<StockBot> Now just need to figure out how to limit it to Ops only
<leftylink> StockBot: yup, check out either Channel#opped? or Channel#ops
<StockBot> ok so they can explain how to limit actionable commands to ops only
<StockBot> thx
StockBot has quit [Ping timeout: 240 seconds]
craysiii has joined #cinch
StockBot has joined #cinch
<StockBot> Is there any way to check is someone is an Op in an channel based on when they send a message with on :message ?
<StockBot> right now im looking in m.user.data.dup
<StockBot> but i did testing with it and the Op shows as false
<dominikh> m.channel.op?(m.user) or something like that
<StockBot> let me try that one
<dominikh> odds are he's not op, then.
<StockBot> Well he was Op but on a makeshift, nonregistered channel
<StockBot> guess i can try on a chanserv registered one
<dominikh> that is irrelevant
<StockBot> ok
<dominikh> was he actually opped at the time?
<StockBot> yes
<dominikh> op, not half op?
<StockBot> full op
<StockBot> Ah ok so pulling from m.channel.users it shows who is oppd
<StockBot> so i need to do a foreach style loop on each oppd user and compare, if true then "ACTION"
<StockBot> Here is the output and puts:
<StockBot> [2017/05/26 20:54:05.184] >> :StockBot!stockbot@1390292.E65D8E1B.4F02FEAA.IP PRIVMSG #lafdebug :!notice tttt
<StockBot> {:user=>"stockbot", :host=>"1390292.E65D8E1B.4F02FEAA.IP", :realname=>"StockBot", :authname=>nil, :idle=>0, :signed_on_at=>nil, :unknown?=>false, :online?=>true, :channels=>[#<Channel name="#laf.war">, #<Channel name="#lafdebug">], :secure?=>false, :away=>nil, :oper?=>false}
<StockBot> {#<Bot nick="WarchatBot">=>[], #<User nick="StockBot">=>["o"], #<User nick="Ignition">=>["o"]}
<StockBot> [2017/05/26 20:54:05.199] !! [New thread] For #<Cinch::Handler @event=:message pattern=#<Cinch::Pattern:0x1e31c38 @prefix=nil, @pattern=/^!notice (.+)/, @suffix=nil>>: #<Thread:0x2596020> -- 1 in total.
<StockBot> So it shows oper false
<StockBot> but then shows that its oppd under the channel.users
<dominikh> oper is IRC network operator
<StockBot> lol, and now i feel like an idiot... i knew that long ago
<StockBot> and completely forgot
<StockBot> ty
<StockBot> so i just need to compare off the m.channel.users list
<StockBot> Ah got it to compare the hash