Skip to content

Commit e401b33

Browse files
committed
Add nightly.link emoji to button
1 parent 73ed73c commit e401b33

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

bot/src/ghutils/core/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def logged_out(self):
1919

2020
class CustomEmoji(Enum):
2121
apps_icon = "apps_icon.png"
22+
nightly_link = "nightly_link.png"
2223

2324
def __init__(self, filename: str):
2425
self.filename = filename
9.02 KB
Loading

bot/src/ghutils/ui/views/select_artifact.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from yarl import URL
1717

1818
from ghutils.core.bot import GHUtilsBot
19+
from ghutils.core.types import CustomEmoji
1920
from ghutils.ui.components.visibility import add_visibility_buttons
2021
from ghutils.utils.discord.commands import AnyInteractionCommand
2122
from ghutils.utils.discord.components import update_select_menu_default
@@ -35,6 +36,7 @@ class ArtifactContainer(Container[Any]):
3536

3637
def set_artifact(
3738
self,
39+
bot: GHUtilsBot,
3840
repo: FullRepository,
3941
branch: str | None,
4042
workflow: Workflow,
@@ -95,6 +97,7 @@ def set_artifact(
9597
if branch and is_normal:
9698
self.button_row.add_item(
9799
Button(
100+
emoji=bot.get_custom_emoji(CustomEmoji.nightly_link),
98101
label="nightly.link",
99102
url=str(
100103
URL("https://nightly.link")
@@ -118,6 +121,7 @@ class SelectArtifactView(LayoutView):
118121
def __init__(
119122
self,
120123
*,
124+
bot: GHUtilsBot,
121125
github: GitHub[Any],
122126
command: AnyInteractionCommand,
123127
repo: FullRepository,
@@ -126,6 +130,7 @@ def __init__(
126130
):
127131
super().__init__(timeout=5 * 60)
128132

133+
self.bot = bot
129134
self.github = github
130135
self.command = command
131136
self.repo = repo
@@ -179,7 +184,7 @@ async def new(cls, interaction: Interaction, repo: FullRepository) -> Self:
179184
)
180185

181186
return cls(
182-
# this is *probably* fine?
187+
bot=GHUtilsBot.of(interaction),
183188
github=github,
184189
command=interaction.command,
185190
repo=repo,
@@ -286,6 +291,7 @@ def set_artifact(self, artifact_name: str) -> bool:
286291

287292
assert self.workflow and self.workflow_run
288293
self.result_container.set_artifact(
294+
self.bot,
289295
self.repo,
290296
self.branch,
291297
self.workflow,

0 commit comments

Comments
 (0)