-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtesting.py
More file actions
29 lines (24 loc) · 773 Bytes
/
testing.py
File metadata and controls
29 lines (24 loc) · 773 Bytes
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
import time
from twitch_plays_hackru import TwitchPlaysOnline, TwitchPlaysOffline
base_options = {
# List of voting options that the TwitchPlays API will detect for.
"OPTIONS": ["1","2","3","hi","bye"],
# how long to count votes
"VOTE_INTERVAL": 5
}
twitch_options = {
"PASS": "oauth:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"BOT": "TwitchPlaysBot",
"CHANNEL": "<YOUR CHANNEL>",
"OWNER": "<YOUR CHANNEL>",
"OPTIONS": base_options["OPTIONS"],
"VOTE_INTERVAL": base_options["VOTE_INTERVAL"]
}
# Initalize the TwitchPlays bot.
tPlays = TwitchPlaysOffline(**base_options)
#tPlays = TwitchPlaysOnline(**twitch_options)
while True:
time.sleep(1)
result = tPlays.vote_result()
if result:
print("players choose : ", result)