-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathNOTES
71 lines (54 loc) · 2.02 KB
/
NOTES
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
const datastore = {
"last_timestamp": 1234567890, // the last time the loop started to fire
// at some point, this may need to be on a per-team basis if I have multiple clients running
"teams": [ $team_id1, $team_id2, $team_id3 ], // e.g., [ T0B7KHWKG ]
// redis set for now
"$team_id:token": $token, // token required to connect to team
"$team_id:channel_id": $channelid, // The channel dedicated to idleRPG - e.g., C7H596WJJ
"$team_id:players": [ $player1, $player2, $player3 ], // Players currently signed up as idleRPG players - e.g., [ U0B7PSQQY ]
// going to store this as a redis set for now, should abstract away at some point
"$team_id:$player_id": {
"team_id": $team_id, // e.g., T0B7KHWKG
"user_id": $user_id, // e.g., U0B7PSQQY
"display_name": $display_name, // e.g., fancybone
"level": 7,
"time_to_level": 1000, // number of seconds until user levels up
"events": { // a list of recent events that happened to the user, FIFO queue limited to X items
$timestamp1: "Penalty applied: 100 seconds added",
$timestamp2: "User leveled up!",
},
"away": false, // is the user currently set to away?
},
};
message event
{
"token": "qFgF0Vbz7rXipUcimb8OYxoo",
"team_id": "T0B7KHWKG",
"api_app_id": "A7G6TLYR0",
"event": {
"type": "message",
"user": "U0B7PSQQY",
"text": "I am a BANANA",
"ts": "1507665553.000020",
"channel": "C7H596WJJ",
"event_ts": "1507665553.000020"
},
"type": "event_callback",
"authed_users": ["U0B7PSQQY"],
"event_id": "Ev7GCRLZGV",
"event_time": 1507665553
}
/idle command
{
"token": "qFgF0Vbz7rXipUcimb8OYxoo",
"team_id": "T0B7KHWKG",
"team_domain": "postfarm",
"channel_id": "C7H596WJJ",
"channel_name": "idlerpg",
"user_id": "U0B7PSQQY",
"user_name": "fancybone",
"command": "/idle",
"text": "banana forever",
"response_url": "https://hooks.slack.com/commands/T0B7KHWKG/254355341188/9MVgTE3C1GSIkQOqzCXmBhks",
"trigger_id": "254224913043.11257608662.9549073c343782eb4b85e2b99830e2fb"
}