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

Scan all nick/host on channel (on event) #140

Open
kofany opened this issue Nov 3, 2022 · 2 comments
Open

Scan all nick/host on channel (on event) #140

kofany opened this issue Nov 3, 2022 · 2 comments

Comments

@kofany
Copy link

kofany commented Nov 3, 2022

Any easy way to scan all host on channel and take action on match?

@nrdufour
Copy link

Looks like an easy way is to add a callback on event 353, which is sent after a join on a channel with the following code:

bot.AddCallback("353", func(e *irc.Event) {
	channel := e.Arguments[2]
	users := e.Arguments[3:]
	fmt.Printf(">>> Channel %s with users: %+v\n", channel, users)
})

Here users is a []string containing the nicks present in the channel the bot joined.

@belak
Copy link
Contributor

belak commented Mar 14, 2023

I have a gist with some notes on this and an implementation for a different IRC library.

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