Minifi the bigext function
All checks were successful
Build and push / changes (push) Successful in 4s
Build and push / Lint-Python (push) Successful in 2s
Build and push / Build-and-Push-Docker (push) Successful in 17s
Build and push / sync-argocd-app (push) Successful in 2s
Build and push / post-status-to-discord (push) Successful in 4s

This commit is contained in:
Luke R 2025-02-26 17:12:02 -08:00
parent a0c4ba4b0a
commit 7c9db7859a
3 changed files with 11 additions and 14 deletions

View File

@ -41,7 +41,6 @@ async def on_ready():
message_id = 1099374735428681758
# Testing
# blap
# channel_id = 932476007439552522
# message_id = 1236011522572943382

View File

@ -390,19 +390,17 @@ class Cheeky(commands.Cog):
required=True,
)
async def bigtext(self, ctx: commands.Context, input_string: str):
final = [
(
":exclamation:"
if c == "!"
else (
":question:"
if c == "?"
else ":regional_indicator_{}:".format(c) if c != " " else " "
)
)
for c in input_string.lower()
]
def char_to_emoji(c: str) -> str:
"""Convert a character to its corresponding Discord emoji representation."""
if c == "!":
return ":exclamation:"
if c == "?":
return ":question:"
if c == " ":
return " "
return f":regional_indicator_{c}:"
final = [char_to_emoji(c) for c in input_string.lower()]
await ctx.respond("".join(final))

View File

@ -73,7 +73,7 @@ def gen_username():
response = requests.get(url, headers=headers).text
soup = BeautifulSoup(response, "html.parser")
username = soup.find("div", {"id": "gencont"}).div.find("p").text
username = soup.find("div", {"id": "textblock0"}).find_next("p").text
return username