blob: 93f26f7664ba2059cffb16c9bf481a02d8b65780 (
plain)
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
|
.Dd December 19, 2018
.Dt ILO-KESI 1 URM
.Sh NAME
.Nm ilo-kesi
.Nd ni li ilo sona pi toki pona.
.Sh SYNOPSIS
.Nm
.Op Fl repl Ar TOKEN
.Sh DESCRIPTION
.Nm
communicates with Discord and scans every message in every channel it is in for the following pattern:
.Li ilo ${ILO_NIMI} o
This is usually:
.Li ilo Kesi o
When this condition is met, the chat message will be posted to the
.Ev TOKI_PONA_TOKENIZER_API_URL
and the resulting parsed sentences will be analyzed for what is being asked, and then it will be done.
This only works on sentences written in the
.Lk hyperlink http://tokipona.org Toki Pona
constructed language.
.Bl -tag -width "routed" -offset -indent -compact
.It Fl repl Ar REPL
When this flag is passed,
.Nm
will function in a mode where it does not connect to discord. This is useful when debugging parts of the grammar parsing. You can pass a junk value to
.Ev DISCORD_TOKEN
to help make testing easier.
.El
.Sh ENVIRONMENT
.Bl -tag -width " " -offset indent -compact
.It Ev DISCORD_TOKEN
Specifies the Discord token that
.Nm
will use for client communication.
.It Ev TOKI_PONA_TOKENIZER_API_URL
Specifies the URL that
.Nm
will use to tokenize Toki Pona sentences. This should be some instance of the following serverless function:
.Lk hyperlink: https://github.com/Xe/x/blob/master/discord/ilo-kesi/function/index.js
The default value for this is:
.Lk hyperlink: https://us-central1-golden-cove-408.cloudfunctions.net/function-1
.It Ev SWITCH_COUNTER_WEBHOOK
Specifies the URL that
.Nm
will use to communicate with
.Lk hyperlink: https://www.switchcounter.science Switch Counter
.
This will be used mainly to read data, unless the user in question is a member of the
.Ev JAN_LAWA
id set.
.It Ev ILO_NIMI
Specifies the name of
.Nm
when being commanded to do stuff. This defaults to
.Li Kesi
.
.It JAN_LAWA
Specifies the list of people (via Discord user ID's) that are allowed to use
.Nm
to submit switch data to
.Lk hyperlink: https://www.switchcounter.science Switch Counter
.
.El
.Sh IMPLEMENTATION NOTES
.Nm
requires a brain created by
.Xr cadeybot 1
.
.Nm
requires a webhook from
.Lk hyperlink: https://www.switchcounter.science Switch Counter
.
.Sh EXAMPLES
ilo-kesi
ilo-kesi -repl
.Sh DIAGNOSTICS
.Ex -std ilo-kesi
.Sh SEE ALSO
.Bl -bullet
.It
.Lk hyperlink: https://discordapp.com Discord
.It
.Lk hyperlink http://tokipona.org Toki Pona
.It
.Lk hyperlink: https://www.switchcounter.science Switch Counter
.El
|