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

Channels list is empty after joinChannels() #5

Closed
RodentOfUnusualSize opened this issue May 20, 2016 · 5 comments
Closed

Channels list is empty after joinChannels() #5

RodentOfUnusualSize opened this issue May 20, 2016 · 5 comments
Assignees

Comments

@RodentOfUnusualSize
Copy link
Collaborator

The joinChannels() function currently looks like this:

def joinChannels(conn):
    channels = []
    for chan in BOTCHANS:
        joinChannel(conn, chan)
    return channels

While it correctly joins all the channels in BOTCHANS, it creates the channels variable as an empty list then never assigns to it... so in the end the function just returns an empty list.

The function should probably be:

def joinChannels(conn):
    return [ joinChannel(conn, chan) for chan in BOTCHANS ]

HOWEVER!

Fixing this reveals numerous other bugs, mostly in channels.py, and makes the bot unusable.

So I'm going to have to take a deep dive. I'm going to fork the project as it is, fix the joinChannels() bug, then stomp down all the other bugs it reveals one at a time.

@KeiroD
Copy link
Collaborator

KeiroD commented May 20, 2016

As per IRC:

[03:57:24AM] <Keiro> Whoops on the assignment. Also added the needs-info tag.
[03:57:55AM] <Keiro> Mostly because I think we need a wee bit more info.
[03:59:55AM] <Thumper> Yes, I can't give you more until I know exactly all the
bugs triggered by fixing joinChannels
[04:00:06AM] <Thumper> Because there are many =)
[04:01:05AM] <Keiro> I know.
[04:01:26AM] <Keiro> I figure you'll fill in further details as you dive into it.
[04:01:38AM] <Keiro> Again, mostly for the sake of keeping track of shite.
[04:02:10AM] <Thumper> Well, once I start digging into it, I'll probably need
you guys around to ask questions
[04:02:27AM] <Thumper> Because it looks like a lot of the bugs have multiple
options for fixing
[04:02:35AM] <Thumper> So it depends on what kind of interface you want
[04:03:10AM] <Keiro> Makes sense.
[04:03:14AM] <Thumper> I'll fork, create a branch, then break it, then bother you
about each fix =)

@dwhagar
Copy link
Owner

dwhagar commented May 20, 2016

I've created a branch, I should have it fixed by the end of the day. Also, changing some of the methods as well. I will write up a document on how it works when I get it stabilized. Going to rejigger how things work a bit, change the list of nick objects to be all the nicks that the bot knows about. Once I have it tested to work properly, I'll re-do the JoinChannels function to use it properly and also redo the praseNames function while I'm at it and all that functionality.

@RodentOfUnusualSize
Copy link
Collaborator Author

So I should unstage my changes?

@dwhagar
Copy link
Owner

dwhagar commented May 20, 2016

Probably, I apologize, but the more I was working on parsing the names from the server, the more problems I was having, that would be solved by making one unified "Bot" object so that the names, channels, and settings were all accessible within the object. I'll try to get my object definition done tonight and merge it.

@dwhagar
Copy link
Owner

dwhagar commented May 23, 2016

Alright, after rebuilding the infrastructure (properly, thank you to both of you, you especially Saria) the bot now should properly fill in the name information upon joining a channel. Please verify though, I've merged everything back to master.

@dwhagar dwhagar closed this as completed Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants