Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions yapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ async def on_voice_state_update(
"is gaming in",
]
segway = random.choice(variety)

voice_channel_message = (
f"@here {member.display_name} {segway} {after.channel.name}"
f"@here {member.display_name} {segway} {after.channel.name}."
)
custom_suffixes = {
"gandhigandhi": "Ask him about his sauerkraut.",
"jdkatfrog": "Wait a minute... that can't be right...",
"randyprice4": "Oh god... is he wearing Heelys? Restrain him!",
"tyfar13": "Hide your printers, hide your chicken parms!",
}
if member.name in custom_suffixes:
voice_channel_message += f" {custom_suffixes[member.name]}"

# Send the notification.
_logger.info(f"sending {CHANNEL_TO_NOTIFY} - {voice_channel_message}")
Expand All @@ -80,7 +89,8 @@ async def on_voice_state_update(
def main() -> None:
"""Start the client and reconnect on failure."""
logging.basicConfig(
format="[%(levelname)s]: %(message)s", level=logging.INFO,
format="[%(levelname)s]: %(message)s",
level=logging.INFO,
)
client.run(AUTHENTICATION_TOKEN, reconnect=True, log_level=logging.INFO)

Expand Down