aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/core/source.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-05-06 16:12:32 +0100
committerGravatar Chris Lovering <[email protected]>2023-05-09 15:41:50 +0100
commit613840ebcf303e84048d48ace37fb001c1afe687 (patch)
tree9acaf0bae0527fe8389483a419b44e06997ca060 /bot/exts/core/source.py
parentMigrate to ruff (diff)
Apply fixes for ruff linting
Co-authored-by: wookie184 <[email protected]> Co-authored-by: Amrou Bellalouna <[email protected]>
Diffstat (limited to 'bot/exts/core/source.py')
-rw-r--r--bot/exts/core/source.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/exts/core/source.py b/bot/exts/core/source.py
index f771eaca..592156fc 100644
--- a/bot/exts/core/source.py
+++ b/bot/exts/core/source.py
@@ -1,6 +1,5 @@
import inspect
from pathlib import Path
-from typing import Optional
from discord import Embed
from discord.ext import commands
@@ -28,7 +27,7 @@ class BotSource(commands.Cog):
embed = await self.build_embed(source_item)
await ctx.send(embed=embed)
- def get_source_link(self, source_item: SourceType) -> tuple[str, str, Optional[int]]:
+ def get_source_link(self, source_item: SourceType) -> tuple[str, str, int | None]:
"""
Build GitHub link of source item, return this link, file location and first line number.
@@ -62,7 +61,7 @@ class BotSource(commands.Cog):
return url, file_location, first_line_no or None
- async def build_embed(self, source_object: SourceType) -> Optional[Embed]:
+ async def build_embed(self, source_object: SourceType) -> Embed | None:
"""Build embed based on source object."""
url, location, first_line = self.get_source_link(source_object)