Skip to content

Commit

Permalink
apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Feb 1, 2024
1 parent 62aafb1 commit d5a12d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
15 changes: 9 additions & 6 deletions simplebot_mastodon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ def dm_cmd(bot: DeltaBot, payload: str, message: Message, replies: Replies) -> N
)
if dmchat:
chat = bot.get_chat(dmchat.chat_id)
replies.add(text="❌ Chat already exists, send messages here", chat=chat)
replies.add(
text="❌ Chat already exists, send messages here", chat=chat
)
return
chat = bot.create_group(
user.acct, bot.get_chat(acc.notifications).get_contacts()
Expand Down Expand Up @@ -514,9 +516,11 @@ def open_cmd(bot: DeltaBot, payload: str, message: Message, replies: Replies) ->
context["ancestors"] + [masto.status(payload)] + context["descendants"]
)
replies.add(
text=TOOT_SEP.join(toots2texts(bot, toots))
if toots
else "❌ Nothing found",
text=(
TOOT_SEP.join(toots2texts(bot, toots))
if toots
else "❌ Nothing found"
),
quote=message,
)
else:
Expand Down Expand Up @@ -565,8 +569,7 @@ def mute_cmd(payload: str, message: Message, replies: Replies) -> None:
def unmute_cmd(payload: str, message: Message, replies: Replies) -> None:
if payload:
replies.add(
text=account_action("account_unmute", payload, message)
or "✔️ User unmuted",
text=account_action("account_unmute", payload, message) or "✔️ User unmuted",
quote=message,
)
return
Expand Down
1 change: 1 addition & 0 deletions simplebot_mastodon/migrations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Database migrations"""

import os
import sqlite3

Expand Down
4 changes: 3 additions & 1 deletion simplebot_mastodon/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def toot2reply(prefix: str, toot: AttribAccessDict, notification: bool = False)
if toot.type == "reblog":
text = f"🔁 {_get_name(toot.account)} boosted your toot. ({timestamp})\n\n"
elif toot.type == "favourite":
text = f"⭐ {_get_name(toot.account)} favorited your toot. ({timestamp})\n\n"
text = (
f"⭐ {_get_name(toot.account)} favorited your toot. ({timestamp})\n\n"
)
elif toot.type == "follow":
return {"text": f"👤 {_get_name(toot.account)} followed you. ({timestamp})"}
elif toot.type == "mention":
Expand Down

0 comments on commit d5a12d1

Please sign in to comment.