@@ -11,7 +11,8 @@ to their friends. As soon as all their friends bought their ticket, they should
11
11
distribute it to another member.
12
12
13
13
This bot simplifies this process by automating parts of it. A yaml file serves as a database, containing a mapping
14
- of vouchers and member accounts.
14
+ of vouchers and member accounts. Optionally, you can enter a number of persons, so you are able to estimate how
15
+ long the voucher will be on it's way.
15
16
16
17
## Features
17
18
@@ -24,11 +25,17 @@ of vouchers and member accounts.
24
25
25
26
Python 3.7 required (TODO: require 3.8 to be able to use TypedDict eventually)
26
27
27
- Copy ` example_voucher.yml ` to ` voucher.yml ` . Enter your vouchers. Make a backup of this file (we do not make one for
28
+ Copy ` example_voucher.yml ` to ` voucher.yml ` . Enter your vouchers and their owners . Make a backup of this file (we do not make one for
28
29
you and we ** WILL** modify this file. Don't cry if something get's lost).
29
30
30
31
Open ` constants.py ` and change ` VOUCHER_TABLE_POST_ID ` . This post will be constantly updated with the table of members
31
32
who currently own a voucher.
32
33
33
34
pip install -r requirements.txt
34
- DISCOURSE_API_KEY=deadbeef python src/app.py --dry # leave out --dry if you are brave
35
+ DISCOURSE_API_KEY=deadbeef python src/app.py --dry # leave out --dry if you are brave
36
+
37
+ The script will send a message with a voucher to each person who is in ` voucher.yml ` . It will save the Discourse topic
38
+ id in the file as ` message_id ` , so it won't send the same message twice.
39
+
40
+ If a user replies to that message, the script will scan for the string ` CHAOS[a-zA-Z0-9]+ ` in their messages. If it
41
+ finds a new voucher, the old voucher in the yml file get's replaced by the new one and all other fields will be reset.
0 commit comments