Skip to content

Commit 6aa0252

Browse files
committed
script to automatically start today's tournaments
1 parent 8c866c2 commit 6aa0252

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

sfcjbot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async def on_message(message):
124124
return
125125

126126
if "about" in command.lower():
127-
await client.send_message(message.author, "SFCJbot is running on a Raspberry Pi and is powered by the following technologies:\nRaspbian GNU/Linux 8 (jessie)\nPython 3.5\nDiscord.py\nMySQL and MySQLdb")
127+
await client.send_message(message.author, "SFCJbot is running on a Raspberry Pi and is powered by the following technologies:\nRaspbian GNU/Linux 8 (jessie)\nPython 3.5\nDiscord.py\nMySQL and MySQLdb\npychallonge")
128128
return
129129

130130
async def add_new_user_if_needed(message):

tournament_starter.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from sys import argv
2+
import challonge
3+
from datetime import date
4+
5+
this_program, challonge_auth_filename = argv
6+
7+
challonge_auth_file = open(challonge_auth_filename)
8+
challonge_username = challonge_auth_file.readline().rstrip()
9+
challonge_key = challonge_auth_file.readline().rstrip()
10+
challonge_auth_file.close()
11+
challonge.set_credentials(challonge_username, challonge_key)
12+
13+
today = str(date.today().isoformat())
14+
15+
tournaments = challonge.tournaments.index(state="pending")
16+
for tournament in tournaments:
17+
if str(tournament["start-at"])[:10] == today:
18+
challonge.tournaments.start(tournament["id"])
19+
20+

0 commit comments

Comments
 (0)