Bot can't write messages even though the account isn't banned

Hey there,

all of a sudden (since about yesterday evening) my bot script (written in Ruby 2.3) isn’t able to send chat messages anymore. However, if I log in to the account manually and send a message to the same channel chat room, it works perfectly.

Also, the script is able to send commands like JOIN to the IRC server because it recieves the handshake. Only messages don’t work. It still recieves messages other users send.

If it’s needed, I can post the source code of the functions that are used here.

~ StuntHacks

You doing PRIVMSG #room words and stuff\r\n

Are you getting any messages back as a notice?

Did you check the RAW send and receive?

Is your bots laura still valid?

Do note the message in PRIVMSG is the trailing part of the IRC command, which is required to start with a :, i.e. the format should be PRIVMSG #channel :message\r\n.

The script is sending well-formed PRIVMSG commands to the server but doesn’t get any response. As I said, it gets a response to commands like JOIN and until yesterday, it worked. Currently, I am not sending an \r\n at the end, but should that really matter?

Yes.

If you or your library is not sending the correct line endings then the PRIVMSG not succeed.

Source code might help

Currently, the method that sends the message looks similar to this (there is some more stuff but this is the interesting part):

def writeToChat(message)
	# some more code
	writeToSystem decode("PRIVMSG ##{@channel} :#{message}")
	# some more code
end

@channel is just a string containing the channel name.

The writeToSystem method just sends the given string as-is to the server. So it should work if I use the correct line ending?

So an example string would look something like this: PRIVMSG #stunthacks :This is a test.

PRIVMSG #stunthacks :This is a test.

That looks correct.

PRIMSG^#channel^:words to send\r\n

Where ^ is a space.

I don’t know if your writeToSystem is writing \r\n

No, it doesn’t. It just sends the string as it is without adding any line-endings or anything else.

That would be your problem then. You need to send the correct “IRC line endings” in order to trigger the PRIVMSG properly

I tried to append the line endings but it still doesn’t work. Would it help if I posted some more of the source code?

EDIT: Apparently it works if I run the script on my local computer instead of the server. Now a different question: May a IP be temporarly banned for being in a channel and writing a message every 10 minutes for about 2 days?

Is the bot account a channel moderator or owner?

No, not yet.

Does modding the bot allow it to send messages while running on the server?

Yes, that works. But the bot might not be mod when in prod all the time.

So looks like the IP range your server is in is shadow banned probably from a malicious user with your same provider. Quick solution is to make sure the bot is modded in any channels it needs to send message to which is a good practice anyway.

Another solution is to contact support and request the bot be whitelisted.

1 Like

Okay so if the bot would get whitelisted, it can write messages without any problem even if it isn’t modded?

But I will probably just disable it’s functionality unless it’s modded.

If it works when modded.

Is the channel the bot you are trying to talk in, in follower only mode?
Does the bot follow the channel that you are trying to talk in?

I had this problem recently and didn’t realise the problem till I remember the channel I was trying to send to, has follower only mode on, and the bot account didn’t follow the channel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.