Skip to content

Commit b2c0ab7

Browse files
committed
STARBOARD FIX
1 parent 95149c7 commit b2c0ab7

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
exclude =
3+
.git,
4+
__pycache__,
5+
.venv,
6+
venv,
7+
build,
8+
dist

cogs/starboard.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async def starboard_setup(self, ctx: commands.Context, channel: discord.TextChan
284284

285285
embed = create_success_embed(
286286
" Starboard Setup Complete!",
287-
f"Your modern starboard system is now active and ready to showcase your community's best messages!"
287+
"Your modern starboard system is now active and ready to showcase your community's best messages!"
288288
)
289289
embed.color = 0x00FF7F # Spring green
290290
embed.add_field(name=" Channel", value=channel.mention, inline=True)
@@ -465,7 +465,7 @@ async def starboard_stats(self, ctx: commands.Context):
465465

466466
embed = discord.Embed(
467467
title="⭐ Starboard Statistics",
468-
description=f"Here's how your server is shining!",
468+
description="Here's how your server is shining!",
469469
color=color
470470
)
471471

@@ -916,7 +916,7 @@ async def update_starboard_message(self, message: discord.Message, star_count: i
916916
async with aiosqlite.connect(self.database_path) as db:
917917
await db.execute("DELETE FROM starred_messages WHERE starboard_message_id = ?", (starboard_msg_id,))
918918
await db.commit()
919-
except Exception as e:
919+
except Exception:
920920
self.logger.exception(f"Error updating starboard message {starboard_msg_id} for original {message.id}")
921921

922922
async def remove_starboard_message(self, starboard_msg_id: int, settings: Dict):
@@ -930,7 +930,7 @@ async def remove_starboard_message(self, starboard_msg_id: int, settings: Dict):
930930
await starboard_msg.delete()
931931
except discord.NotFound:
932932
pass # Already deleted
933-
except Exception as e:
933+
except Exception:
934934
self.logger.exception(f"Error removing starboard message {starboard_msg_id}")
935935

936936
async def create_starboard_embed(self, message: discord.Message, star_count: int, settings: Dict) -> discord.Embed:
@@ -952,7 +952,8 @@ async def create_starboard_embed(self, message: discord.Message, star_count: int
952952
content = content[:1500] + "..."
953953

954954
# Highlight the message by using a block quote style in the description
955-
description = f"> {content.replace('\n', '\n> ')}"
955+
quoted_content = content.replace("\n", "\n> ")
956+
description = f"> {quoted_content}"
956957

957958
embed = discord.Embed(
958959
description=description,

utils/codingquestions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
def get_random_question():
2020
"""Returns a non repeating randomized question"""
21-
global _index, _question_pool
21+
global _index
2222

2323
if _index >= len(_question_pool):
2424
random.shuffle(_question_pool)
@@ -28,6 +28,8 @@ def get_random_question():
2828
_index += 1
2929
return fix_question(q)
3030

31+
32+
3133
def fix_question(question):
3234
"""Randomizes options while keeping the correct answer accurate."""
3335
# Extract answer text.

0 commit comments

Comments
 (0)