Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
Signed-off-by: Sammy <375162+theresnotime@users.noreply.github.com>
  • Loading branch information
theresnotime authored Oct 2, 2024
2 parents a1e4223 + 945cbaa commit 9be3834
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
It's a silly fedi bot (currently at https://fox.nexus/@treats).

### Possible combinations
There are 118 folx and 226 treats, resulting in 26,668 possible combinations.
There are 155 folx and 317 treats, resulting in 49,135 possible combinations.

## Contributing
### Setting up
Expand Down
70 changes: 65 additions & 5 deletions arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"fox.nexus users",
"honeycomb.engineer users",
"Yassie",
"Yasseenists",
"Yaseenists",
"Folx that use they/them",
"Open source maintainers",
"Package maintainers",
Expand Down Expand Up @@ -101,14 +101,14 @@
"Subscribers",
"Software supply chains",
"Infosec mavens",
"Rapid response furries",
"Robos",
"Drones",
"We",
"Omegas",
"Alphas",
"Queer people",
"Debian Maintainers",
"Debian Developers",
"Debian Developers, uploading",
"Debian Developers, non-uploading",
"Humanoids",
Expand Down Expand Up @@ -146,10 +146,29 @@
"Everyone in the closet",
"Disabled people",
"That kind person at the grocery store",
"Criters",
"Critters",
"Non-human entities",
"Therians",
"No one",
"Nerds",
"Dorks",
"Cat lovers",
"Dog lovers",
"Gardeners",
"Claire",
"A random MediaWiki extension",
"A random MediaWiki skin",
"MediaWiki",
"Skin:Citizen",
"Extension:Cargo",
"Miraheze",
"Starfleet captains",
"Klingons",
"Romulans",
"Vulcans",
"Ferengi",
"The Borg",
"Soong-type androids",
]

# The case of these will not be changed
Expand Down Expand Up @@ -255,7 +274,7 @@
"a 7200 RPM hard drive",
"a zero-day exploit",
"a cute little collar",
"a subpost",
"*this* subpost",
"a little nap",
"trailing commas",
"paw beans",
Expand Down Expand Up @@ -339,6 +358,7 @@
"a demagnetised cassette tape",
"a spicy GitHub tarball",
"an sshd backdoor",
"an orphan source",
"a new neo* emoji pack",
"a timezone change",
"a Potion of Invisibility",
Expand Down Expand Up @@ -459,10 +479,50 @@
"a wink",
"some new plants",
"a shiny thing",
"a capitalism's downfall",
"capitalism's downfall",
"the right to grumble at leisure all day long",
"a bite",
"carcinisation",
"a brand new box of floppy disks",
"a picture frame containing a projection of everything in the universe",
"a back rub",
"all those meetings cancelled",
"breakfast in bed",
"alt text",
"a cat making biscuits",
"a piece of helpful advice",
"an unexpected long weekend",
"a ride in the front seat upstairs on a double-decker bus",
"a CloudStrike",
"rail renationalisation",
"spammy push notifications",
"a poorly described Jira ticket",
"a squeaky toy",
"a surprise tax rebate",
"a little bit of pud",
"an extra fluffy pillow",
"a discount code for 15% off",
"tone indicators",
"control of the aux",
"a reminder to like and subscribe",
"a sponsorship from PCBWay",
"an indecipherable compiler error",
"a cloned Yubikey",
"some copper from Ea-nāṣir",
"a live service game shutdown",
"a very non-suspicious giant wooden horse",
"an arrow to the knee",
"a security vulnerability",
"a patch",
"an XSS",
"a SQL injection",
"a CSRF vulnerability",
"a fun cat fact",
"a warp core breach",
"a new Monster of the Week",
"membership in the Federation",
"subspace interference",
"a bowl of Gagh",
"an emotion chip",
"36 bars of gold-pressed Latinum",
]
31 changes: 31 additions & 0 deletions gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import random
import sys
from arrays import FOLX, TREATS
from datetime import datetime, timezone
from enum import Enum
from mastodon import Mastodon

Expand Down Expand Up @@ -45,6 +46,26 @@ def count_combinations() -> None:
print(output)


def update_bio(dry_run: bool = False) -> None:
"""Update the bot's bio with the number of possible combinations"""
num_folx = len(FOLX)
num_treats = len(TREATS)
combinations = num_folx * num_treats
last_update = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
bio = f"You can have another bot, as a treat.\n\nI can choose from {num_folx} folx and {num_treats} treats, so there are {combinations:,} possible combinations.\n\nI last updated this bio on {last_update} (UTC)."

if dry_run is False:
mastodon = Mastodon(
access_token=config.ACCESS_TOKEN, api_base_url=config.API_URL
)
mastodon.account_update_credentials(note=bio)
log.info("Updated bio to: %s", bio)
print(f"Updated bio to: {bio}")
else:
print(f"Dry run, would have updated bio to: {bio}")
log.info("Dry run, would have updated bio to: %s", bio)


def write_status(
status: str, dry_run: bool = False, visibility: Visibility = Visibility("unlisted")
) -> None:
Expand Down Expand Up @@ -123,6 +144,12 @@ def clear_used(thing: str) -> None:
action="store_true",
help="Count the number of possible outputs and exit",
)
parser.add_argument(
"-u",
"--update-bio",
action="store_true",
help="Update the bot's bio with the number of possible combinations",
)
parser.add_argument(
"--visibility",
type=Visibility,
Expand All @@ -144,6 +171,10 @@ def clear_used(thing: str) -> None:
count_combinations()
sys.exit(0)

if args.update_bio:
update_bio(args.dry_run)
sys.exit(0)

used_folx = get_used("folx")
used_treats = get_used("treats")

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exclude =
__pycache__,
config.py
max-line-length = 286
ignore = W503, E722
ignore = W503, E722, E231

[isort]
profile = black
Expand Down

0 comments on commit 9be3834

Please sign in to comment.