eggdrop icon indicating copy to clipboard operation
eggdrop copied to clipboard

.status vs [status] vs state of a channel

Open ZarTek-Creole opened this issue 4 years ago • 2 comments

in .status we can see the status of the channels. If the show is pending, if the eggdrop is on it etc. In the help, [status] says to be the equivalent, but no information is given for the channels.

I tried the get channel and the info channel, it doesn't matter any status information. Is there a way to know the status of a channel from TCL?

ZarTek-Creole avatar Jan 30 '21 20:01 ZarTek-Creole

I finally opted for this method:

foreach C_NAME [channels] {
	set B_MODE ""
	if { [botisop $C_NAME] }		{ set B_MODE "@" }
	if { [botishalfop $C_NAME] }	{ set B_MODE "%" }
	if { [botisvoice  $C_NAME] }	{ set B_MODE "+" }
	if { [botonchan   $C_NAME] }	{ set COLOR "\00310"; } else { set COLOR "\00304"; }
	lappend LIST_CHANNELS "${COLOR}${B_MODE}${C_NAME}"
	unset B_MODE COLOR C_NAME
}

I still think .status is more complete than [status] maybe some work should be done for an update.

cputime 31.739666 expmem 215849 ipv6 disabled tls {OpenSSL 1.1.1i 8 Dec 2020} usercache { 0.2} trim space before { 0.2} ? OS alias from unames ? TCL version ? Tcl library? Process ID? Threaded DNS core? CAP?

ZarTek-Creole avatar Jan 31 '21 14:01 ZarTek-Creole

The trouble we have here is the potential to break API, since status is returning a string- in theory, people could be expecting that specific fixed-value string to come back for a script. We could either make a new command that uses dicts and is more extendible, or wait for 2.0 to just re-do this 'better'.

vanosg avatar May 08 '21 14:05 vanosg