Skip to content

Commit

Permalink
Periodic reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rosalogia committed Oct 19, 2020
1 parent 9d49e55 commit 357b9a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions cogs/covidcog.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ def embedCreator(data):
embed.add_field(
name=f"Total {state} Cases",
value="Total Cases: {:,} {}".format(
data["cases"],
f"(+{todayCases})" if todayCases != 0 else ""
),
data["cases"], f"(+{todayCases})" if todayCases != 0 else ""
),
inline=True,
)
embed.add_field(
name=f"Total {state} Deaths",
value="Total Deaths: {:,} {}".format(
data["deaths"],
f"(+{todayDeaths})" if todayDeaths != 0 else ""
),
data["deaths"], f"(+{todayDeaths})" if todayDeaths != 0 else ""
),
inline=True,
)
embed.add_field(
Expand Down
5 changes: 2 additions & 3 deletions cogs/currencycog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ async def cconvert(self, ctx, base, target, amount: float = 1):

try:
payload = {"symbols": target, "base": base}
r = requests.get(
"https://api.exchangeratesapi.io/latest", params=payload)
r = requests.get("https://api.exchangeratesapi.io/latest", params=payload)
apidata = r.json()
result = float(apidata["rates"][target])*amount
result = float(apidata["rates"][target]) * amount

embed = discord.Embed(title="Currency Conversion")
embed.add_field(name=f"From {base}:", value=f"```{amount}```")
Expand Down
2 changes: 1 addition & 1 deletion cogs/translatecog.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, bot):
async def translate(self, ctx, lang_from, lang_to, *args):
"""Input a 2 letter code for lang_from and lang_to, and then the text to be translated"""
input_str = " ".join(args)
safe_input_str = urllib.parse.quote(input_str, safe='')
safe_input_str = urllib.parse.quote(input_str, safe="")
url = f"https://translate.googleapis.com/translate_a/single?client=gtx&sl={lang_from}&tl={lang_to}&dt=t&q={safe_input_str}"
req = requests.get(url)
try:
Expand Down

0 comments on commit 357b9a8

Please sign in to comment.