Skip to content

Commit

Permalink
Merge branch 'v0.4.0'
Browse files Browse the repository at this point in the history
Merge @yntl fix and rewrite of the core functions into master
  • Loading branch information
m1kql committed Oct 25, 2021
2 parents 4a8e38b + f69e918 commit db052ef
Show file tree
Hide file tree
Showing 8 changed files with 983 additions and 1,073 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ Prefix: `=`

<u>Miscellaneous</u>
<br>
| Command | Has Arguments | Arguments | Expected Output |
| ---------- | ------------- | ----------------- | ------------------------------------------------------------------------------------------ |
| `=suggest` | Yes | `your message` | Allows you to make a feature suggestion or any suggestion. Needs you to complete a captcha |
| `=report` | Yes | `your message` | Allows you to make a bug report or any report on an issue. Needs you to complete a captcha |
| `=runcode` | Yes | `language` `code` | Runs code from different languages. |
| Command | Has Arguments | Arguments | Expected Output |
| ---------- | ------------- | ---------------------------------- | ------------------------------------------------------------------------------------------ |
| `=suggest` | Yes | `your message` | Allows you to make a feature suggestion or any suggestion. Needs you to complete a captcha |
| `=report` | Yes | `your message` | Allows you to make a bug report or any report on an issue. Needs you to complete a captcha |
| `=runcode` | Yes | `language` `code` `file extension` | Runs code from different languages. |

## Contributing

Expand Down
479 changes: 237 additions & 242 deletions bot/src/cogs/math/amc10_problems.py

Large diffs are not rendered by default.

479 changes: 237 additions & 242 deletions bot/src/cogs/math/amc12_problems.py

Large diffs are not rendered by default.

842 changes: 417 additions & 425 deletions bot/src/cogs/math/contest_problems.py

Large diffs are not rendered by default.

33 changes: 14 additions & 19 deletions bot/src/cogs/misc/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ async def suggest(self, ctx, *, message):
captcha_answer = str(captchas[random_captcha])
await ctx.send(file=discord.File("bot/src/cogs/misc/captcha.png"))

def check_answer(answer):
a_msg = answer.content
a_author = answer.author
if a_msg == captcha_answer and a_author == ctx.author:
return True
else:
return False

answer = await self.bot.wait_for("message", check=check_answer) # noqa F841
answer = await self.bot.wait_for( # noqa F841
"message",
check=(
lambda answer: answer.content == captcha_answer
and answer.author == ctx.author
),
)
channel = await self.bot.fetch_channel(feature_channel)
await ctx.send("Correct CAPTCHA submission.")
await channel.send(
Expand All @@ -94,16 +92,13 @@ async def report(self, ctx, *, message):
)
captcha_answer = str(captchas[random_captcha])
await ctx.send(file=discord.File("bot/src/cogs/misc/captcha.png"))

def check_answer(answer):
a_msg = answer.content
a_author = answer.author
if a_msg == captcha_answer and a_author == ctx.author:
return True
else:
return False

answer = await self.bot.wait_for("message", check=check_answer) # noqa F841
answer = await self.bot.wait_for( # noqa F841
"message",
check=(
lambda answer: answer.content == captcha_answer
and answer.author == ctx.author
),
)
channel = await self.bot.fetch_channel(bug_channel)
await ctx.send("Correct CAPTCHA submission.")
await channel.send(
Expand Down
67 changes: 19 additions & 48 deletions bot/src/cogs/utility/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from dotenv import load_dotenv
import os
import json

load_dotenv()

Expand All @@ -19,54 +20,24 @@


def buildJSON():
JSONstring = (
"{"
+ "\n"
+ '"type"'
+ ":"
+ f'"{firebase_type}"'
+ ","
+ '"project_id"'
+ ":"
+ f'"{firebase_project_id}"'
+ ","
+ '"private_key_id"'
+ ":"
+ f'"{firebase_private_key_id}"'
+ ","
+ '"private_key"'
+ ":"
+ f'"{firebase_private_key}"'
+ ","
+ '"client_email"'
+ ":"
+ f'"{firebase_client_email}"'
+ ","
+ '"client_id"'
+ ":"
+ f'"{firebase_client_id}"'
+ ","
+ '"auth_uri"'
+ ":"
+ f'"{firebase_auth_uri}"'
+ ","
+ '"token_uri"'
+ ":"
+ f'"{firebase_token_uri}"'
+ ","
+ '"auth_provider_x509_cert_url"'
+ ":"
+ f'"{firebase_auth_provider_x509_cert_url}"'
+ ","
+ '"client_x509_cert_url"'
+ ":"
+ f'"{firebase_client_x509_cert_url}"'
+ "\n"
+ "}"
)
f = open("firebase_config.json", "w")
f.write(JSONstring)
f.close()
with open("firebase_config.json", "w", encoding="utf-8") as f:
f.write(
json.dumps(
{
"type": firebase_type,
"project_id": firebase_project_id,
"private_key_id": firebase_private_key_id,
"private_key": firebase_private_key,
"client_email": firebase_client_email,
"client_id": firebase_client_id,
"auth_uri": firebase_auth_uri,
"token_uri": firebase_token_uri,
"auth_provider_x509_cert_url": firebase_auth_provider_x509_cert_url,
"client_x509_cert_url": firebase_client_x509_cert_url,
}
)
)

return "firebase_config.json"


Expand Down
73 changes: 27 additions & 46 deletions bot/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,42 @@
aiohttp==3.7.4.post0
aiopyston==1.2.1
appdirs==1.4.4
async-timeout==3.0.1
attrs==21.2.0
black==21.5b1
CacheControl==0.12.6
cachetools==4.2.2
cachetools==4.2.4
captcha==0.3
certifi==2020.12.5
cffi==1.14.5
certifi==2021.10.8
chardet==4.0.0
click==8.0.0
discord.py==1.7.2
firebase-admin==5.0.0
flake8==3.9.2
google-api-core==1.28.0
google-api-python-client==2.5.0
google-auth==1.30.0
charset-normalizer==2.0.7
discord.py==1.7.3
firebase-admin==5.0.3
google-api-core==2.1.1
google-api-python-client==2.27.0
google-auth==2.3.0
google-auth-httplib2==0.1.0
google-cloud-core==1.6.0
google-cloud-firestore==2.1.1
google-cloud-storage==1.38.0
google-crc32c==1.1.2
google-resumable-media==1.3.0
google-cloud-core==2.1.0
google-cloud-firestore==2.3.4
google-cloud-storage==1.42.3
google-crc32c==1.3.0
google-resumable-media==2.0.3
googleapis-common-protos==1.53.0
grpcio==1.38.0
httplib2==0.19.1
idna==2.10
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
mccabe==0.6.1
grpcio==1.41.0
httplib2==0.20.1
idna==3.3
msgpack==1.0.2
multidict==5.1.0
mypy-extensions==0.4.3
packaging==20.9
pathspec==0.8.1
Pillow==8.1.0
proto-plus==1.18.1
protobuf==3.17.0
multidict==5.2.0
packaging==21.0
Pillow==8.4.0
proto-plus==1.19.5
protobuf==3.19.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
PyNaCl==1.4.0
pyparsing==2.4.7
python-dotenv==0.17.1
pytz==2021.1
regex==2021.4.4
requests==2.25.1
python-dotenv==0.19.1
requests==2.26.0
rsa==4.7.2
six==1.16.0
toml==0.10.2
typing-extensions==3.10.0.0
uritemplate==3.0.1
urllib3==1.26.4
Werkzeug==2.0.1
wheezy.captcha==3.0.1
yarl==1.6.3
typing-extensions==3.10.0.2
uritemplate==4.1.1
urllib3==1.26.7
yarl==1.7.0
73 changes: 27 additions & 46 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,42 @@
aiohttp==3.7.4.post0
aiopyston==1.2.1
appdirs==1.4.4
async-timeout==3.0.1
attrs==21.2.0
black==21.5b1
CacheControl==0.12.6
cachetools==4.2.2
cachetools==4.2.4
captcha==0.3
certifi==2020.12.5
cffi==1.14.5
certifi==2021.10.8
chardet==4.0.0
click==8.0.0
discord.py==1.7.2
firebase-admin==5.0.0
flake8==3.9.2
google-api-core==1.28.0
google-api-python-client==2.5.0
google-auth==1.30.0
charset-normalizer==2.0.7
discord.py==1.7.3
firebase-admin==5.0.3
google-api-core==2.1.1
google-api-python-client==2.27.0
google-auth==2.3.0
google-auth-httplib2==0.1.0
google-cloud-core==1.6.0
google-cloud-firestore==2.1.1
google-cloud-storage==1.38.0
google-crc32c==1.1.2
google-resumable-media==1.3.0
google-cloud-core==2.1.0
google-cloud-firestore==2.3.4
google-cloud-storage==1.42.3
google-crc32c==1.3.0
google-resumable-media==2.0.3
googleapis-common-protos==1.53.0
grpcio==1.38.0
httplib2==0.19.1
idna==2.10
itsdangerous==2.0.1
Jinja2==3.0.1
MarkupSafe==2.0.1
mccabe==0.6.1
grpcio==1.41.0
httplib2==0.20.1
idna==3.3
msgpack==1.0.2
multidict==5.1.0
mypy-extensions==0.4.3
packaging==20.9
pathspec==0.8.1
Pillow==8.1.0
proto-plus==1.18.1
protobuf==3.17.0
multidict==5.2.0
packaging==21.0
Pillow==8.4.0
proto-plus==1.19.5
protobuf==3.19.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.7.0
pycparser==2.20
pyflakes==2.3.1
PyNaCl==1.4.0
pyparsing==2.4.7
python-dotenv==0.17.1
pytz==2021.1
regex==2021.4.4
requests==2.25.1
python-dotenv==0.19.1
requests==2.26.0
rsa==4.7.2
six==1.16.0
toml==0.10.2
typing-extensions==3.10.0.0
uritemplate==3.0.1
urllib3==1.26.4
Werkzeug==2.0.1
wheezy.captcha==3.0.1
yarl==1.6.3
typing-extensions==3.10.0.2
uritemplate==4.1.1
urllib3==1.26.7
yarl==1.7.0

0 comments on commit db052ef

Please sign in to comment.