Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opping and kicking on freenode.net #110

Closed
fbstj opened this issue Oct 6, 2012 · 4 comments
Closed

opping and kicking on freenode.net #110

fbstj opened this issue Oct 6, 2012 · 4 comments

Comments

@fbstj
Copy link

fbstj commented Oct 6, 2012

All I'm trying to do is get my bot to kick a nick from a channel

To do that I need +o, which according to the docs I should bot.send('MODE', channel, '+o', bot.nick)

When I do that it throws:

./node_modules/irc/lib/irc.js:548
                    throw err;
                          ^
Error: Uncaught, unspecified 'error' event.
    at Client.EventEmitter.emit (events.js:70:15)
    at Client.<anonymous> (./node_modules/irc/lib/irc.js:432:26)
    at Client.EventEmitter.emit (events.js:93:17)
    at Client.connect (./node_modules/irc/lib/irc.js:545:22)
    at Array.forEach (native)
    at Socket.Client.connect (./node_modules/irc/lib/irc.js:542:15)
    at Socket.EventEmitter.emit (events.js:93:17)
    at TCP.onread (net.js:391:31)

and I have no idea how to kick.

messaging chanserv for ops works, but I cant find an equivalent way to kick.

Thanks. I am an IRC-bot n00b

@quentinxs
Copy link
Contributor

The exception thrown is not from the mode command, but from the error received from the IRC server (see issue #107). Other than that your client is behaving as expected. Having the bot send /mode #somechannel +o nodebot is equivalent to having the bot try to give itself privileges it doesn't already have. Having another user/service give operator privileges to your bot is the correct method.

As for kicking, the format used is /kick <channel> <nick> [<comment>]

@fbstj
Copy link
Author

fbstj commented Oct 7, 2012

Would that be bot.send('KICK', channel, nick, 'no comment') ? as I got the same error response when doing that.

Thanks for the clarification, it makes sense that I'd need to ask chanserv for it now.

@quentinxs
Copy link
Contributor

Go into the node-irc code, and change irc.js line 432 from:
self.emit('error', message);
to:
self.emit('ircError', message);

Also, set showErrors to true and run it again. If you still have trouble, here are a list of possible error messages returned from KICK:

ERR_NEEDMOREPARAMS   -- make sure you have at least 2 parameters (channel and nick)
                        comment is optional and doesn't need to be included
ERR_NOSUCHCHANNEL    -- indicates channel name is invalid
ERR_NOSUCHNICK       -- the user you are kicking is not online
ERR_CHANOPRIVSNEEDED -- you need to have operator privileges before kicking
ERR_USERNOTINCHANNEL -- user needs to be on the channel you want to kick them from
ERR_NOTONCHANNEL     -- you also need to be on the channel you're kicking from

@martynsmith
Copy link
Owner

Yeah, as @qsheets points out, you need to be an operator on a channel before you can kick someone, and you can't make yourself an operator (someone has to grant you that).

This seems like most likely not a bug, I'm going to close it. Feel free to re-open it if you continue to have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants