knrd1 / chatgpt

ChatGPT IRC bot
https://github.com/knrd1/chatgpt
MIT License
36 stars 7 forks source link

The bot does not join to the channels #17

Closed moonlightz closed 1 year ago

moonlightz commented 1 year ago

Hi. First of all, congratulations. Finally something simple that works. There is a minor problem. It can't seem to join any channel, unless forced using sajoin. The default .conf file has 2 channels listed, so I am only wanting to make the bot joining to a single channel. So I just edited the channels as #channelname. The first time I ran python3 chatgpt.py, it kept doing nothing until I pressed ctrl and c. Then I retried again, this time it connected to the irc server but it didn't join. I had to use sajoin. The python script seems to be doing its job. Unless, the channels line needs to be channels = #channelname, with the comma at the end. Anyways, again congrats for the efforts. It's long awaited.

knrd1 commented 1 year ago

Thanks for your message, I can't replicate the issue on IRCNet, here is my config, I just tested few minutes ago:

[irc]
server = open.ircnet.net
port = 6667
ssl = false
channels = #mytestchannel
nickname = Botello
ident = bot
realname = ChatGPT IRC Bot
password = 

Bot joins channels, it doesn't matter you specify one, two or more channels. What IRC network you are having this issue? I'm wondering if this is specific to some IRC networks. On IRCNet there's no issue, thanks.

moonlightz commented 1 year ago

It's me again. No matter what I do, it won't join the single channel. I didn't try with 2 channels. I tried to add time.sleep(2) before "JOIN "... but no joy. The lack of logs of the irc responses makes me clueless. The bot joins to the irc server and does nothing. The nickname, ident, realname seems to be filled ok but for some reason, it won't join to the channel I choose. The ssl does work fine. The channels is just a normal channel. The irc network: unrealircd 5.0.9

moonlightz commented 1 year ago

[16:39:24] -irc.ptchat.org- *** Client connecting: ChatGPT (chatgpt@bl20-106-248.dsl.telepac.pt) [2.81.106.248] [secure: TLSv1.2-ECDHE-RSA-AES256-GCM-SHA384] [class: clients] [reputation: 10000] [16:39:40] -irc.ptchat.org- moonlight used SAJOIN to make ChatGPT join #code

moonlightz commented 1 year ago

I have no doubts that it works joining channels automatically. It's just not working with me. It could be python's irc module or something else.

moonlightz commented 1 year ago

[irc] server = ie.ptchat.org port = 6697 ssl = true channels = #CODE nickname = ChatGPT ident = chatgpt realname = ChatGPT powered by OpenAI password =

I think the bot does realise that it didn't join to the channel. └─$ python3 --version 1 ⚙ Python 3.11.2

└─$ pip3 show irc 1 ⚙ Name: irc Version: 0.0.8.5.3 Summary: IRC (Internet Relay Chat) protocol client library for Python Home-page: http://python-irclib.sourceforge.net Author: Joel Rosdahl Author-email: joel@rosdahl.net License: MIT Location: /usr/lib/python3/dist-packages Requires: Required-by:

knrd1 commented 1 year ago

You are right, thanks. I just tested on "unrealircd" and can confirm it doesn't automatically join channels. I will get this resolved soon. For the time being, you can invite the bot to the channel from your client, I used this command in irssi: /invite MyBot #channel

moonlightz commented 1 year ago

Thanks for testing. Maybe trying to testing with another unrealircd network and see if the issue still happens. I have no idea why the bot fails to join. I built myself a tcl minimal bot for minimal tasks and it never had a problem joining to channels. The command is: foreach channel $lchannels {sendtxt "JOIN $channel"} . It uses a normal JOIN command. It uses the normal JOIN command. Again thanks for testing.

gokturkyilmaz commented 1 year ago

Thanks for testing. Maybe trying to testing with another unrealircd network and see if the issue still happens. I have no idea why the bot fails to join. I built myself a tcl minimal bot for minimal tasks and it never had a problem joining to channels. The command is: foreach channel $lchannels {sendtxt "JOIN $channel"} . It uses a normal JOIN command. It uses the normal JOIN command. Again thanks for testing.

I was also thinking opening an issue about this. I'm running InspIRCd-3.15.0 and the bot doesn't join the channels automatically. Hope this issue can be fixed as soon as possible. Also; also that would be more better if could add 'modes' for the bot in config, thanks.

knrd1 commented 1 year ago

Thanks, I'm aware of the issue, this is being investigated (bot auto-joins channels on some IRC networks, it doesn't on others).

Please can you elaborate on "modes"? What kind of modes you are looking for?

gokturkyilmaz commented 1 year ago

Thanks, I'm aware of the issue, this is being investigated (bot auto-joins channels on some IRC networks, it doesn't on others).

Please can you elaborate on "modes"? What kind of modes you are looking for?

Thanks for quick response. Any of user modes that can be added for the bot when connected to server. On InspIRCd i'm using these modes for bots; "ChatGPT is using modes +BDIaiw"

knrd1 commented 1 year ago

This has been fixed, please pull the latest version.