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

How to use data from one event handler in a different one? #227

Open
ahopelesshadow opened this issue Apr 18, 2024 · 0 comments
Open

How to use data from one event handler in a different one? #227

ahopelesshadow opened this issue Apr 18, 2024 · 0 comments

Comments

@ahopelesshadow
Copy link

I'm not sure if this is an issue as much of a question, its entirely possible I'm doing something wrong.

But lets say i write an event handler on_privmsg with

if event.arguments[0] == ".whois":
    whois = server.whois(event.arguments[1])
    userip = server.send_items("USERIP", event.arguments[1])
    server.privmsg(event.target, f"{whois} {userip}")

the issue here is while inside of that function, my event handlers for on_whois and on_iplookup do not fire, as the bot can only receive one response at a time. I wrote and defined the proper functions to parse out both whois and userip, and they both work, if i f10 through the entire program, but the problem there is my on_privmsg event has ended at that point... so when i go to reply with the variables in the fstring, they show as none...

So I guess my question is how can i get the data from those other two functions back into my privmsg function as the events wernt caught yet?

I did see another issue relating to whois, and the reply was to create a handler to catch and parse out the reply. I have done that and it works, but i cant seem to figure out how to use the data from that function.

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

1 participant