Previous
Next
Table of Contents
3.3 Functions for scripts
A special Python module, called pyirc
provides various
useful functions for writing scripts. Here is the description of these
functions, which are part of the pyirc
module.
- echo(message, window="-"): prints
<message> in the window named <window>. If <window>
is omitted, prints the message in the server window.
- openwindow(window="-"): ensures that
<window> is showed, or opens it if it does not exist.
- closewindow(window): closes <window>.
- existwindow(window): returns 1 is
<window> exists, 0 otherwise.
- hasnick(channel, nick): returns 1 if you are on
<channel> and <nick> is on <channel> too, 0 otherwise.
- ischanop(channel, nick): returns 1 if you are
on <channel> and <nick> is channel operator on
<channel>
- getstring(title, text, password = 0): pops up a
dialog with title <title>, a <text> and a line editor. If
<password> is 1, the line editor will not show what is typed.
- nickname(): returns your current nickname.
- window(): returns the window from which the
last command was issued.
- encode(text): converts <text> to an
encoded string.
- decode(text): decodes a <text> produced
by encode().
- stime(time): returns a string representing the
time in English, that correspond to <time> seconds since the
epoch.
Previous
Next
Table of Contents