Closed juderosen closed 10 years ago
First of all, the bot can't op itself. If you want to op somebody who sends a command to the bot try something like:
on :message, /^!op/ do |m|
m.channel.op(m.user)
end
For kick you need to do the same thing:
on :message, /somethingidontwantsaid/i do |m|
m.channel.kick(m.user, reason = "Please, do not say that.")
end
I don't have the ability to check my syntax 100% at the moment, but take a look at the Message and Channel classes and some of the examples (I'd say the autovoice example should help you out a bit.) to help with these errors.
Thanks. That worked wonders.
I've installed Cinch and made a nice bot that replies to regex, but I cannot do things like op and kick. Here's some of what I've tried:
I get this error when I run my code (not the example code above, my actual code, which has all the same stuff in it, just in a different order):
What am I doing wrong? I did give my bot ops, so, I don't know what's going on.
If it helps, I'm running Ruby 2.0.0 x64 on Windows 7 x64.