<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Willie</id>
	<title>Willie - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Willie"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Willie&amp;action=history"/>
	<updated>2026-05-08T23:03:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Willie&amp;diff=1621&amp;oldid=prev</id>
		<title>Kenneth: /* Configure */</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Willie&amp;diff=1621&amp;oldid=prev"/>
		<updated>2015-01-23T15:00:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Configure&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Willie ==&lt;br /&gt;
&lt;br /&gt;
Willie - Willie - The Python IRC Bot - http://willie.dftba.net/&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
Dependencies: [https://github.com/embolalia/willie/wiki/System-Requirements]&lt;br /&gt;
 sudo yum install libxml2-devel libxslt-devel enchant&lt;br /&gt;
 sudo pip install feedparser pytz lxml praw pyenchant pygeoip&lt;br /&gt;
 sudo pip install IPython&lt;br /&gt;
&lt;br /&gt;
Install Willie&lt;br /&gt;
 sudo pip install willie&lt;br /&gt;
&lt;br /&gt;
Python 2.7 has a bug, to fix:&lt;br /&gt;
 # error: ImportError: No module named backports.ssl_match_hostname&lt;br /&gt;
 sudo pip install backports.ssl_match_hostname&lt;br /&gt;
&lt;br /&gt;
== Execute ==&lt;br /&gt;
&lt;br /&gt;
To run Willie, run as a non root user:&lt;br /&gt;
 $ willie&lt;br /&gt;
&lt;br /&gt;
To fork (background):&lt;br /&gt;
 $ willie -f&lt;br /&gt;
&lt;br /&gt;
== Configure ==&lt;br /&gt;
&lt;br /&gt;
To configure, run as a non root user, and answer the few questions:&lt;br /&gt;
 $ willie&lt;br /&gt;
&lt;br /&gt;
This will create the config directory:&lt;br /&gt;
 ~/.willie/&lt;br /&gt;
 ~/.willie/default.cfg&lt;br /&gt;
&lt;br /&gt;
Note: when specifying a channel, make sure to prefix with &amp;quot;#&amp;quot;&lt;br /&gt;
&lt;br /&gt;
~/.willie/default.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[core]&lt;br /&gt;
nick = billybob&lt;br /&gt;
host = myirc.server.com&lt;br /&gt;
use_ssl = False&lt;br /&gt;
port = 6667&lt;br /&gt;
owner = billyowner&lt;br /&gt;
channels = #billybob,#somethingelse&lt;br /&gt;
&lt;br /&gt;
admins = user1,user2&lt;br /&gt;
enable = echo,help,adminchannel,autoop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
 .help&lt;br /&gt;
 .commands&lt;br /&gt;
 .c 5 / 2&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
&lt;br /&gt;
Note: multiple modules can be placed into the same file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ~/.willie/modules/helloworld.py&lt;br /&gt;
import willie&lt;br /&gt;
&lt;br /&gt;
# .hello world&lt;br /&gt;
@willie.module.commands(&amp;#039;helloworld&amp;#039;)&lt;br /&gt;
def helloworld(bot, trigger):&lt;br /&gt;
    bot.say(&amp;#039;Hello, world!&amp;#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ~/.willie/modules/echo.py&lt;br /&gt;
import willie&lt;br /&gt;
&lt;br /&gt;
# .echo with arguments&lt;br /&gt;
@willie.module.commands(&amp;#039;echo&amp;#039;)&lt;br /&gt;
def echo(bot, trigger):&lt;br /&gt;
    bot.reply(trigger.group(2))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ~/.willie/modules/hi.py&lt;br /&gt;
import willie&lt;br /&gt;
&lt;br /&gt;
# regex&lt;br /&gt;
@willie.module.rule(&amp;#039;hello!?&amp;#039;)&lt;br /&gt;
def hi(bot, trigger):&lt;br /&gt;
    bot.say(&amp;#039;Hi, &amp;#039; + trigger.nick)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Core modules exist here:&lt;br /&gt;
 /opt/python-2.7.9/lib/python2.7/site-packages/willie/modules/&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* Willie tutorial, Part 2 · embolalia/willie Wiki · GitHub - https://github.com/embolalia/willie/wiki/Willie-tutorial%2C-Part-2&lt;br /&gt;
&lt;br /&gt;
== Core Modules ==&lt;br /&gt;
&lt;br /&gt;
Core modules exist here:&lt;br /&gt;
 /opt/python-2.7.9/lib/python2.7/site-packages/willie/modules/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adminchannel.py - op, deop, &lt;br /&gt;
admin.py&lt;br /&gt;
announce.py&lt;br /&gt;
bugzilla.py&lt;br /&gt;
calc.py&lt;br /&gt;
chanlogs.py&lt;br /&gt;
clock.py&lt;br /&gt;
countdown.py&lt;br /&gt;
currency.py&lt;br /&gt;
dice.py&lt;br /&gt;
etymology.py&lt;br /&gt;
find.py&lt;br /&gt;
find_updates.py&lt;br /&gt;
github.py&lt;br /&gt;
help.py - help, commands&lt;br /&gt;
ip.py&lt;br /&gt;
ipython.py&lt;br /&gt;
isup.py&lt;br /&gt;
lmgtfy.py&lt;br /&gt;
meetbot.py&lt;br /&gt;
movie.py&lt;br /&gt;
ping.py&lt;br /&gt;
radio.py&lt;br /&gt;
rand.py&lt;br /&gt;
reddit.py&lt;br /&gt;
reload.py&lt;br /&gt;
remind.py&lt;br /&gt;
rss.py&lt;br /&gt;
safety.py&lt;br /&gt;
search.py&lt;br /&gt;
seen.py&lt;br /&gt;
spellcheck.py&lt;br /&gt;
tell.py&lt;br /&gt;
tld.py&lt;br /&gt;
translate.py&lt;br /&gt;
unicode_info.py&lt;br /&gt;
units.py&lt;br /&gt;
uptime.py&lt;br /&gt;
url.py&lt;br /&gt;
version.py&lt;br /&gt;
weather.py&lt;br /&gt;
wikipedia.py&lt;br /&gt;
wiktionary.py&lt;br /&gt;
xkcd.py&lt;br /&gt;
youtube.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Custom Modules ==&lt;br /&gt;
&lt;br /&gt;
=== admins can op themselves ===&lt;br /&gt;
&lt;br /&gt;
Owner/Admins can op themselves&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- adminchannel.py.old 2015-01-22 15:12:31.893968888 -0700&lt;br /&gt;
+++ adminchannel.py     2015-01-22 15:11:25.985975053 -0700&lt;br /&gt;
@@ -37,8 +37,12 @@&lt;br /&gt;
     Command to op users in a room. If no nick is given,&lt;br /&gt;
     willie will op the nick who sent the command&lt;br /&gt;
     &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
-    if bot.privileges[trigger.sender][trigger.nick] &amp;lt; OP:&lt;br /&gt;
-        return&lt;br /&gt;
+    #if bot.privileges[trigger.sender][trigger.nick] &amp;lt; OP:&lt;br /&gt;
+    #    return&lt;br /&gt;
+    if not (trigger.nick == bot.config.owner or&lt;br /&gt;
+         trigger.nick in bot.config.admins.split(&amp;#039;,&amp;#039;) or&lt;br /&gt;
+         bot.privileges[trigger.sender][trigger.nick] == OP):&lt;br /&gt;
+             return&lt;br /&gt;
     if bot.privileges[trigger.sender][bot.nick] &amp;lt; OP:&lt;br /&gt;
         return bot.reply(&amp;quot;I&amp;#039;m not a channel operator!&amp;quot;)&lt;br /&gt;
     nick = trigger.group(2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== auto op admins ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ~/.willie/modules/autoop.py&lt;br /&gt;
import willie&lt;br /&gt;
&lt;br /&gt;
@willie.module.event(&amp;#039;JOIN&amp;#039;)&lt;br /&gt;
@willie.module.rule(&amp;#039;.*&amp;#039;)&lt;br /&gt;
def autoop(bot, trigger):&lt;br /&gt;
    nick = trigger.nick&lt;br /&gt;
    channel = trigger.sender&lt;br /&gt;
    if bot.privileges[channel][bot.nick] &amp;lt; willie.module.OP:&lt;br /&gt;
        return # not a channel operator!&lt;br /&gt;
    if (nick == bot.config.owner or&lt;br /&gt;
        nick in bot.config.admins.split(&amp;#039;,&amp;#039;)):&lt;br /&gt;
            bot.say(&amp;#039;Hi, &amp;#039; + trigger.nick)&lt;br /&gt;
            bot.write([&amp;#039;MODE&amp;#039;, channel, &amp;quot;+o&amp;quot;, nick])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
[[Category:IRC]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>