Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#25): add mcve command #30

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/byte/plugins/forums.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"""Plugins related to forums."""

import discord
from discord import Thread
from discord import Embed, Interaction, Thread
from discord.app_commands import command as app_command
from discord.ext.commands import Bot, Cog, Context, command, hybrid_command

from src.byte.lib.common import litestar_logo_yellow, mcve

__all__ = ("ForumCommands", "setup")


Expand Down Expand Up @@ -53,6 +57,26 @@ async def tags(self, ctx: Context) -> None:
tags = ctx.channel.applied_tags
await ctx.send(f"Tags in this channel: {', '.join([tag.name for tag in tags])}")

@app_command(name="mcve")
async def tree_sync(self, interaction: Interaction) -> None:
"""Slash command to request an MCVE from a user.

Args:
interaction: Interaction object.
"""
await interaction.response.send_message("Processing request...", ephemeral=True)

embed = Embed(title="MCVE needed to reproduce!", color=0x42B1A8)
embed.add_field(name="Hi", value=f"{interaction.user.mention}", inline=True)
embed.add_field(
name="MCVE",
value=f"Please include an [MCVE](<{mcve}>) so that we can reproduce your issue locally.",
inline=True,
)
embed.set_thumbnail(url=litestar_logo_yellow)

await interaction.followup.send(embed=embed)


async def setup(bot: Bot) -> None:
"""Add cog to bot.
Expand Down