This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

eggdrop does not detect joins/parts

General support and discussion of Eggdrop bots.
Post Reply
d
daigo
Voice
Posts: 37
Joined: Fri Jun 27, 2014 8:02 pm

eggdrop does not detect joins/parts

Post by daigo »

I am using the latest stable version of eggdrop, and in the conf I have the line:

Code: Select all

logfile djhkoprstv #channel "logs/channel.log"
It has everything in the logs except joins/parts.

I tried starting eggdrop with:

Code: Select all

./eggdrop -nt
But it doesn't display any joins/parts.

When I do:

Code: Select all

.channel #testchan
It returns:

Code: Select all

[11:38:54] #daigo# (#testchan) channel
Processing channel #testchan, 1 member, mode +:
End of channel info.
Even though there are many users in the channel.

Here is .status:

Code: Select all

[12:14:06] #daigo# status
I am daigobot, running eggdrop v1.6.21: 4 users (mem: 73k).
Online for 01:28 (terminal mode) - CPU: 00:00 - Cache hit: 61.5%
Configured with:  '--enable-strip' '--with-handlen=32'
Admin: daigo <email: daigo@daigo.com>
Config file: eggdrop.conf
OS: CYGWIN_NT-6.1-WOW64 1.7.15(0.260/5/3)
Tcl library: ./lib/tcl8.5
Tcl version: 8.5.11 (header version 8.5.11)
Socket table: 20/100
Loaded module information:
    Channels: #testchan (trying)
    Online as: daigobot (daigobot)
    Server 199.9.253.199:6667 (connected for 01:28)
    #testchan        : (pending)
it says (trying) and (pending), not sure what that means.

Here is what the console says with +r, and then I try to get the users on the channel by dumping names:

Code: Select all


[12:39:58] Writing channel file...
[12:39:58] Userfile loaded, unpacking...
[12:39:58] [@] tmi.twitch.tv NOTICE * :NICK already set
[12:39:58] -NOTICE- NICK already set
[12:39:58] net: eof!(read) socket 10
[12:39:58] Disconnected from 199.9.253.199
[12:39:59] Identd: Listening On Port 113, Replying as daigobot***
[12:39:59] Trying server 199.9.253.199:6667
[12:40:00] net: connect! sock 10
[12:40:00] Connected to 199.9.253.199
[12:40:00] [@]
[12:40:00] [@] tmi.twitch.tv 001 daigobot :Welcome, GLHF!
[12:40:00] Identd: Disabled.
[12:40:00] [@] tmi.twitch.tv 002 daigobot :Your host is tmi.twitch.tv
[12:40:00] [@] tmi.twitch.tv 003 daigobot :This server is rather new
[12:40:00] [@] tmi.twitch.tv 004 daigobot :-
[12:40:00] [@] tmi.twitch.tv 375 daigobot :-
[12:40:00] [@] tmi.twitch.tv 372 daigobot :You are in a maze of twisty passages
, all alike.
[12:40:00] [@] tmi.twitch.tv 376 daigobot :>
[12:40:04] [@] tmi.twitch.tv 421 daigobot WHOIS :Unknown command
[12:40:06] [@] daigobot!daigobot@daigobot.tmi.twitch.tv JOIN #testchan
[12:40:06] daigobot joined #testchan.
[12:40:06] [@] jtv!jtv@jtv.tmi.twitch.tv PRIVMSG daigobot :HISTORYEND testchan
[12:40:06] [jtv!jtv@jtv.tmi.twitch.tv] HISTORYEND testchan
[12:40:06] [@] daigobot.tmi.twitch.tv 353 daigobot = #testchan :amy adam john paul daigobot
[12:40:06] [@] daigobot.tmi.twitch.tv 366 daigobot #testchan :End of /NAMES
 list
[12:40:06] [@] jtv MODE #testchan +o amy
[12:40:06] #testchan: mode change '+o amy' by jtv
[12:40:06] [@] tmi.twitch.tv 421 daigobot WHO :Unknown command
[12:40:38] tcl: builtin dcc call: *dcc:dump daigo 7 names #testchan
[12:40:38] #daigo# dump names #testchan
[12:40:39] [@] tmi.twitch.tv 421 daigobot NAMES :Unknown command
The "onchan" function also has issues. The command: .tcl onchan daigo #testchan returns a value of 0, even though I am in the same channel at the bot and interacting with it using TCL scripts, etc.

When I part and rejoin the channel, I get:

Code: Select all

[15:01:06] [@] daigobot.tmi.twitch.tv 353 daigobot = #testchan :amy adam john paul daigobot
[15:01:06] [@] daigobot.tmi.twitch.tv 366 daigobot #testchan :End of /NAMES list
[15:01:06] [@] tmi.twitch.tv 421 daigobot WHO :Unknown command
[15:04:32] tcl: evaluate (.tcl): putserv "names #testchan"
Tcl:
[15:04:35] [@] tmi.twitch.tv 421 daigobot NAMES :Unknown command
So it's definitely using RPL_NAMREPLY automatically I think, but after that, the NAMES command does not work manually.

What is odd is that other programs like mIRC and Mibbit see users joining/parting, but only eggdrop does not recognize users joining/parting.
t
thommey
Halfop
Posts: 76
Joined: Tue Apr 01, 2008 2:59 pm

Post by thommey »

The Twitch chat doesn't really use IRC. Other clients might work fine because they can work without some of the requirements eggdrop has (here: /who). However, I managed to work around some of the Twitch chat limitations by pretending that they work with a Tcl script. Try loading this:

Code: Select all

package require eggdrop 1.6.20
package require Tcl 8.5

bind raw - 353 twitch:names
bind raw - 366 twitch:eonames
bind out - "% queued" twitch:who

proc twitch:who {queue text status} {
	lassign [split $text] cmd chan
	if {$cmd ne "WHO"} { return 0 }
	# fake a names reply with the nicknames we remember (due to chanlist not being cleared, 1.6.21 bug)
	twitch:names $::server 353 "$::botnick = $chan :[join [chanlist $chan]]"
	twitch:eonames $::server 366 "$::botnick $chan :End of /NAMES list"
	return 1
}

# testuser.tmi.twitch.tv 353 testuser = #testchannel :testuser2 testuser
proc twitch:names {from key text} {
	set nicks [lassign [split $text] botnick = chan]
	# get rid of the ":"
	set nicks [join $nicks]
	if {[string index $nicks 0] eq ":"} {
		set nicks [string range $nicks 1 end]
	}
	set nicks [split $nicks]
	foreach nick $nicks {
		# fake WHO reply:
		# underworld2.no.quakenet.org 352 TCL #testchannel tcl TCL.users.quakenet.org *.quakenet.org TCL Hx :0 #testchannel
		*raw:irc:352 $from 352 "$::botnick $chan $nick $nick.tmi.twitch.tv $::server $nick H :0 $chan"
	}
	return 0
}

# testuser.tmi.twitch.tv 366 testuser #testchannel :End of /NAMES list
proc twitch:eonames {from key text} {
	lassign [split $text] botnick chan
	# first, make sure the bot knows it's on the channel, fake 352
	*raw:irc:352 $from 352 "$::botnick $chan $::botnick $::botnick.tmi.twitch.tv $::server $::botnick H :0 $chan"
	# fake end of WHO reply
	# underworld2.no.quakenet.org 315 TCL #testchannel:End of /WHO list.
	*raw:irc:315 $from 315 "$::botnick $chan :End of /WHO list."
	return 0
}
Post Reply