Skip to content

Commit 86ab3a7

Browse files
committed
Black formatting
1 parent 224afd5 commit 86ab3a7

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

core/thread.py

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,12 @@ async def snooze(self, moderator=None, command_used=None, snooze_for=None):
224224
"author_name": (
225225
getattr(m.embeds[0].author, "name", "").split(" (")[0]
226226
if m.embeds and m.embeds[0].author and m.author == self.bot.user
227-
else getattr(m.author, "name", None)
228-
if m.author != self.bot.user
229-
else None
227+
else getattr(m.author, "name", None) if m.author != self.bot.user else None
230228
),
231229
"author_avatar": (
232230
getattr(m.embeds[0].author, "icon_url", None)
233231
if m.embeds and m.embeds[0].author and m.author == self.bot.user
234-
else m.author.display_avatar.url
235-
if m.author != self.bot.user
236-
else None
232+
else m.author.display_avatar.url if m.author != self.bot.user else None
237233
),
238234
}
239235
async for m in channel.history(limit=None, oldest_first=True)
@@ -2662,7 +2658,15 @@ async def create(
26622658
thread.ready = False # not ready yet
26632659

26642660
class _ThreadCreationMenuSelect(discord.ui.Select):
2665-
def __init__(self, bot, outer_thread: Thread, option_data: dict, menu_msg: discord.Message, path: list, is_home: bool = True):
2661+
def __init__(
2662+
self,
2663+
bot,
2664+
outer_thread: Thread,
2665+
option_data: dict,
2666+
menu_msg: discord.Message,
2667+
path: list,
2668+
is_home: bool = True,
2669+
):
26662670
self.bot = bot
26672671
self.outer_thread = outer_thread
26682672
self.option_data = option_data
@@ -2677,7 +2681,11 @@ def __init__(self, bot, outer_thread: Thread, option_data: dict, menu_msg: disco
26772681
for o in option_data.values()
26782682
]
26792683
if not is_home:
2680-
options.append(discord.SelectOption(label="main menu", description="Return to the main menu", emoji="🏠"))
2684+
options.append(
2685+
discord.SelectOption(
2686+
label="main menu", description="Return to the main menu", emoji="🏠"
2687+
)
2688+
)
26812689
super().__init__(
26822690
placeholder=placeholder,
26832691
min_values=1,
@@ -2724,7 +2732,7 @@ async def callback(self, interaction: discord.Interaction):
27242732
is_home=False,
27252733
)
27262734
return await self.menu_msg.edit(view=new_view)
2727-
2735+
27282736
self.outer_thread._selected_thread_creation_menu_option = self.path
27292737
# Reflect the selection in the original DM by editing the embed/body
27302738
try:
@@ -2964,13 +2972,30 @@ async def callback(self, interaction: discord.Interaction):
29642972
ctx_.command.checks = old_checks
29652973

29662974
class _ThreadCreationMenuView(discord.ui.View):
2967-
def __init__(self, bot, outer_thread: Thread, option_data: dict, menu_msg: discord.Message, path: list, is_home: bool = True):
2975+
def __init__(
2976+
self,
2977+
bot,
2978+
outer_thread: Thread,
2979+
option_data: dict,
2980+
menu_msg: discord.Message,
2981+
path: list,
2982+
is_home: bool = True,
2983+
):
29682984
super().__init__(timeout=timeout)
29692985
self.outer_thread = outer_thread
29702986
self.path = path
29712987
self.menu_msg = menu_msg
29722988
self.option_data = option_data
2973-
self.add_item(_ThreadCreationMenuSelect(bot, outer_thread, option_data=option_data, menu_msg=menu_msg, path=self.path, is_home=is_home))
2989+
self.add_item(
2990+
_ThreadCreationMenuSelect(
2991+
bot,
2992+
outer_thread,
2993+
option_data=option_data,
2994+
menu_msg=menu_msg,
2995+
path=self.path,
2996+
is_home=is_home,
2997+
)
2998+
)
29742999

29753000
async def on_timeout(self):
29763001
# Timeout -> abort thread creation
@@ -3094,7 +3119,9 @@ async def on_timeout(self):
30943119
logger.debug("Thumbnail set failed (ignored): %s", e)
30953120
menu_msg = await recipient.send(embed=embed)
30963121
option_data = self.bot.config.get("thread_creation_menu_options") or {}
3097-
menu_view = _ThreadCreationMenuView(self.bot, thread, option_data, menu_msg, path=[], is_home=True)
3122+
menu_view = _ThreadCreationMenuView(
3123+
self.bot, thread, option_data, menu_msg, path=[], is_home=True
3124+
)
30983125
menu_msg = await menu_msg.edit(view=menu_view)
30993126
# mark thread as pending menu selection
31003127
thread._pending_menu = True

0 commit comments

Comments
 (0)