Skip to content

Commit 4a8e38b

Browse files
committed
Merge branch 'v0.3.1'
fix path parsing for cmo and also fix db
2 parents 26631f7 + 5c41872 commit 4a8e38b

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
<br>
55
</div>
66

7-
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/yak-fumblepack/pi/Build?logo=github&logoColor=lightgrey&style=plastic">
7+
<div>
8+
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/workflow/status/yak-fumblepack/pi/Build?logo=github&logoColor=lightgrey&style=plastic">
89
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/yak-fumblepack/pi?style=plastic">
910
<img alt="GitHub" src="https://img.shields.io/github/license/yak-fumblepack/pi?style=plastic">
1011
<a href="https://discord.com/api/oauth2/authorize?client_id=842500814625832990&permissions=0&scope=bot"><img src="https://img.shields.io/badge/Invite-7289DA?style=plastic&logo=discord&logoColor=white" alt="Invite the bot to your discord server"></a>
12+
</div>
1113

1214
## Overview
1315

bot/src/cogs/math/contest_problems.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async def cmo(self, ctx):
146146

147147
cmo_year = random.randint(1969, 1973)
148148
cmo_question = random.randint(1, 9)
149-
requested_path = "CMO/%d/%d", cmo_year, cmo_question
149+
requested_path = f"CMO/{cmo_year}/{cmo_question}"
150150

151151
await ctx.send(
152152
f"https://raw.githubusercontent.com/yak-fumblepack/mathcontests/master/{requested_path}/statement.png"
@@ -177,9 +177,9 @@ async def aime(self, ctx):
177177
requested_path = ""
178178

179179
if aime_year < 2000:
180-
requested_path = "AIME/%d/%d", aime_year, aime_question
180+
requested_path = f"AIME/{aime_year}/{aime_question}"
181181
else:
182-
requested_path = "AIME/%d/%s/%d", aime_year, aime_version, aime_question
182+
requested_path = f"AIME/{aime_year}/{aime_version}/{aime_question}"
183183

184184
await ctx.send(
185185
f"https://raw.githubusercontent.com/yak-fumblepack/mathcontests/master/{requested_path}/statement.png"

bot/src/cogs/utility/db.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ async def open_user_db(guild_id, user_id):
114114
usajmo_attempted: 0,
115115
amc10_points: 0,
116116
amc12_points: 0,
117+
cmo_attempted: 0,
117118
}
118119
db.collection(str(guild_id)).document(str(user_id)).set(data)
119120

@@ -141,3 +142,8 @@ async def get_guild_db(guild_id):
141142
return guild_collection
142143
except Exception:
143144
pass
145+
146+
147+
async def get_all():
148+
collection_ref = db.collections()
149+
return collection_ref

bot/src/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
aiohttp==3.7.4.post0
2+
aiopyston==1.2.1
23
appdirs==1.4.4
34
async-timeout==3.0.1
45
attrs==21.2.0

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
aiohttp==3.7.4.post0
2+
aiopyston==1.2.1
23
appdirs==1.4.4
34
async-timeout==3.0.1
45
attrs==21.2.0

0 commit comments

Comments
 (0)