forked from Charcoal-SE/pingbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pingbot-sample-config.cfg
138 lines (123 loc) · 5.96 KB
/
pingbot-sample-config.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Comment lines which have a space following the # are explanatory comments.
# Lines which don't have that space are commented-out parts of the configuration
# file, which you could uncomment if appropriate. The explanatory comments tell
# you under what circumstances that would be appropriate.
[user]
# This is the email address associated with the Stack Exchange user account the
# bot should use. (OpenID login is not supported... yet.) This needs to be
# a moderator account so that it has access to the Teacher's Lounge to check for
# mod activity.
email = [email protected]
# This is the password of the account given above.
password = example
# Whether to leave the room identified in the [room] section (below) when the
# bot terminates. If this is set to true, and the mod whose account is being
# used is logged in from a browser at the time the bot terminates, it will kick
# them out of that room in the browser too, so it's usually best to leave this
# on false unless the mod never uses chat normally.
leave_on_close = false
[room]
# The ID of the room in which the bot posts messages and listens for commands.
# This should be the private moderator chat room which wants pings. The user
# account identified above has to have write access to this room. You will need
# to create a section in the configuration file labeled [room_ID], where ID is
# the numeric ID of the room you've created (or the special value "terminal").
# For example, if you use
#id=37817
# (which is a testing room created by me, DZ) then you will have to have a
# section called [room_37817] somewhere down in the file. Go look for it; it's
# already here, commented out.
#
# For testing, you can put "terminal" here, and the bot will use a fake chat
# room which reads messages from standard input and prints messages to standard
# output. That way, you can test how it works without risking polluting a real
# chat room or annoying people with superpings.
#
# Alternatively, you can put the room ID of a real chat room that you've
# created for testing. No sensitive information will be exposed by the bot if
# you use a public room here.
id = terminal
# Whether to check Teacher's Lounge for moderator activity. This affects the
# determination of which mod is most recently active, when choosing one to ping.
# If this is set to false and the id is set to "terminal", the bot will operate
# without connecting to Stack Exchange at all.
watch_tl = true
[DEFAULT]
# The default setting for the string template the bot should use when it wants
# to ping someone. In the template, "{}" will be replaced with the username of
# the person to ping. This default is set to something that doesn't match the
# real template SE chat uses for pings, so that if you run the bot for real,
# connecting to chat and everything, but you forget to change these templates,
# it won't actually ping anybody (so you can safely test without annoying
# people).
ping_format = %{}
# The default setting for the template the bot should use when it wants to
# superping someone. In this case, "{}" will be replaced with the numeric ID of
# the person to ping. The rest of the description above applies to this as well.
#
# Note that if the bot is using a non-moderator SE chat account, superpings will
# not actually work regardless of what goes here.
superping_format = %%{}
[room_terminal]
# In the fake terminal room, there is no danger of pinging somebody, so the bot
# can use the real ping and superping templates.
ping_format = @{}
superping_format = @@{}
# For the fake terminal room, since it doesn't actually interface with SE chat,
# it needs some way to produce a list of who's in the room. This is a list of
# chat user IDs which will be considered to be currently in the room. They don't
# need to correspond to real chat user IDs, although if the bot is set to watch
# Teacher's Lounge for activity (see watch_tl, above), you might want to use
# real moderator chat IDs to get a more realistic picture of how the pinging
# algorithm works.
current_user_ids = 1, 2, 4, 8
# This is a list of chat user IDs which will be considered pingable, but not
# currently in the room. There is no need to include the IDs from the previous
# list here; they will automatically be added. If an ID does appear in both
# lists it will be considered present.
pingable_user_ids = 3, 5, 7, 11, 13
# The fake terminal room doesn't pay any attention to the login information
# above, so it needs some way to identify which chat user it is running as (or,
# which user it should pretend it's running as). This should be one of the
# values in current_user_ids.
user_id = 1
# If you put a room ID in the [room] section above, you need to have a
# corresponding config file section for the room. For example, if you use the ID
# of the testing room, 37817, you need to uncomment this line:
#[room_37817]
# The section can be empty, but if you want to use real pings and real
# superpings, you will need to put the proper templates in here, by uncommenting
# the following lines. You would do this if the room ID'd in the section header
# is the actual moderator room that you want actual pings in.
#ping_format = @{}
#superping_format = @@{}
[moderators]
# Name of a file containing a JSON-serialized data structure describing the
# sites recognized by the bot and who their moderators are.
filename = moderators.json
# The remainder of this file configures the Python logging system, and is
# documented in the logging module. This sample configuration creates a file
# "pingbot.log" in the folder where the bot program is run, and logs
# informational messages to that file; it also prints anything serious to the
# console.
[loggers]
keys = root
[handlers]
keys = stream, file
[formatters]
keys = standard
[logger_root]
level = NOTSET
handlers = file
[handler_stream]
class = StreamHandler
level = WARNING
formatter = standard
args = (sys.stderr,)
[handler_file]
class = FileHandler
level = INFO
formatter = standard
args = ('pingbot.log', 'w')
[formatter_standard]
format = %(asctime)s [%(name)s:%(levelname)s] %(message)s