aboutsummaryrefslogtreecommitdiff
path: root/docs/ilo-kesi.1.md
blob: 05e35aa5f7623071b16c9f9f76c32b1eaf65b10d (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
ILO-KESI(1) - General Commands Manual (urm)

# NAME

**ilo-kesi** - ni li ilo sona pi toki pona.

# SYNOPSIS

**ilo-kesi**
\[**-repl** *TOKEN*]

# DESCRIPTION

**ilo-kesi**
communicates with Discord and scans every message in every channel it is in for the following pattern:

`ilo ${ILO_NIMI} o`

This is usually:

`ilo Kesi o`

When this condition is met, the chat message will be posted to the
`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
[http://tokipona.org Toki Pona](hyperlink)
constructed language.

**-repl** *REPL*

> When this flag is passed,
> **ilo-kesi**
> 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
> `DISCORD_TOKEN`
> to help make testing easier.

# ENVIRONMENT

`DISCORD_TOKEN`

> Specifies the Discord token that
> **ilo-kesi**
> will use for client communication.

`TOKI_PONA_TOKENIZER_API_URL`

> Specifies the URL that
> **ilo-kesi**
> will use to tokenize Toki Pona sentences. This should be some instance of the following serverless function:

> [https://github.com/Xe/x/blob/master/discord/ilo-kesi/function/index.js](hyperlink:)

> The default value for this is:

> [https://us-central1-golden-cove-408.cloudfunctions.net/function-1](hyperlink:)

`SWITCH_COUNTER_WEBHOOK`

> Specifies the URL that
> **ilo-kesi**
> will use to communicate with
> [https://www.switchcounter.science Switch Counter](hyperlink:)
> This will be used mainly to read data, unless the user in question is a member of the
> `JAN_LAWA`
> id set.

`ILO_NIMI`

> Specifies the name of
> **ilo-kesi**
> when being commanded to do stuff. This defaults to
> `Kesi`

JAN\_LAWA

> Specifies the list of people (via Discord user ID's) that are allowed to use
> **ilo-kesi**
> to submit switch data to
> [https://www.switchcounter.science Switch Counter](hyperlink:)

# IMPLEMENTATION NOTES

**ilo-kesi**
requires a brain created by
cadeybot(1)

**ilo-kesi**
requires a webhook from
[https://www.switchcounter.science Switch Counter](hyperlink:)

# EXAMPLES

ilo-kesi

ilo-kesi -repl

# DIAGNOSTICS

The **ilo-kesi** utility exits 0 on success, and >0 if an error occurs.

# SEE ALSO

*	[https://discordapp.com Discord](hyperlink:)

*	[http://tokipona.org Toki Pona](hyperlink)

*	[https://www.switchcounter.science Switch Counter](hyperlink:)

 \- December 19, 2018