|
Revision 1, 2.4 kB
(checked in by devja..@anarkystic.com, 2 years ago)
|
initial commit to devja
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
init phase: |
|---|
| 6 |
load command line arguments |
|---|
| 7 |
load plugins |
|---|
| 8 |
|
|---|
| 9 |
generate factory |
|---|
| 10 |
|
|---|
| 11 |
call factory-level hooks |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
run |
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
default jibot: |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
j |
|---|
| 26 |
j.channels = [jibtest] |
|---|
| 27 |
jibtest = Channel() |
|---|
| 28 |
|
|---|
| 29 |
logging plugin: |
|---|
| 30 |
jibtest.log = jibotPlugin_Logging |
|---|
| 31 |
.get_last(i) |
|---|
| 32 |
.get_first(i) |
|---|
| 33 |
.get_count(i) |
|---|
| 34 |
.get_last_action(nick) |
|---|
| 35 |
.get_last_channel(nick) |
|---|
| 36 |
.get_nick_info(nick) |
|---|
| 37 |
time as nick |
|---|
| 38 |
last changed to nick from |
|---|
| 39 |
|
|---|
| 40 |
.get_channel_info(channel) |
|---|
| 41 |
total messages |
|---|
| 42 |
max nicks |
|---|
| 43 |
min nicks |
|---|
| 44 |
avg nicks |
|---|
| 45 |
general stats |
|---|
| 46 |
|
|---|
| 47 |
def plugin: |
|---|
| 48 |
jibtest.def = jibotPlugin_Definitions |
|---|
| 49 |
.get_def(nick) |
|---|
| 50 |
.add_def(nick,def) |
|---|
| 51 |
.del_def_by_def(nick,def_list) |
|---|
| 52 |
.del_def_by_index(nick,def_index_list) |
|---|
| 53 |
.normalize_def(def) |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
users plugin |
|---|
| 57 |
jibtest.users |
|---|
| 58 |
.get_list_global |
|---|
| 59 |
.get_list(channel) |
|---|
| 60 |
.part(channel,user) |
|---|
| 61 |
.change_nick(oldnick,newnick) |
|---|
| 62 |
.join(channel,user) |
|---|
| 63 |
.get_last_join(nick) |
|---|
| 64 |
.get_aliases(nick) |
|---|
| 65 |
do some math based on time in channel |
|---|
| 66 |
.is_identified(nick) |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
herald plugin: |
|---|
| 70 |
jibtest.herald |
|---|
| 71 |
.herald_enabled |
|---|
| 72 |
.herald_unknown |
|---|
| 73 |
.herald_timeout |
|---|
| 74 |
.get_unknown_herald |
|---|
| 75 |
.get_herald(nick) |
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
jibotPlugin_Heralding |
|---|
| 84 |
def __init__(self): |
|---|
| 85 |
pass |
|---|
| 86 |
|
|---|
| 87 |
def init_factory(self,f): |
|---|
| 88 |
f.config.register_type('herald') |
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
def should_herald(self,nick,channel): |
|---|
| 92 |
if not self.bot.herald.enabled: |
|---|
| 93 |
return False |
|---|
| 94 |
if not self.bot.channels[channel].herald.enabled: |
|---|
| 95 |
return False |
|---|
| 96 |
if not self.bot.users[nick].config['heralding_enabled']: |
|---|
| 97 |
return False |
|---|
| 98 |
if self.bot.users[nick].time_since_last_seen() < self.channels[channel].config['heralding_timeout'] |
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
class agent: |
|---|
| 103 |
def __init__(self,realm): |
|---|
| 104 |
self.prefs = get_prefs('herald',realm) |
|---|
| 105 |
self.enabled = self.prefs.enabled |
|---|
| 106 |
self.timeout = self.prefs. |
|---|
| 107 |
self. |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
class Jibot: |
|---|
| 112 |
channels = |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
class Channel: |
|---|
| 117 |
name = "" |
|---|
| 118 |
admins = [] |
|---|
| 119 |
|
|---|
| 120 |
heralding = bool |
|---|
| 121 |
unknown_herald = bool |
|---|
| 122 |
herald_timeout = bool |
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
jibtest = self |
|---|
| 126 |
|
|---|