How can I return a list of all the channels the bot is on (not only those that are defined in the config. file but all the chans the bot is on) ?
The command "channels" returns the list of the channels the bot is monitoring (or trying to). Meaning channels that are defined in the bot's configuration file only.
If I make the bot join a channel by using .+chan <chan_name> then that channel will not be included in the list returned by the command "channels" and so I am getting an error in my script.
You can view the channels by using .status.
If you mean a Tcl command, 'channels' is the correct command, you just need to do a botonchan check to see if the bot is actually on the channel.