diff --git a/issues/issues.py b/issues/issues.py index 3f031fd..a75eac9 100644 --- a/issues/issues.py +++ b/issues/issues.py @@ -1,5 +1,5 @@ from typing import Union -from redbot.core import commands, Config +from redbot.core import commands, Config, app_commands import discord class Issues(commands.Cog): @@ -9,13 +9,14 @@ class Issues(commands.Cog): def __init__(self, bot): self.bot = bot self.config = Config.get_conf(self, identifier=4285273314713, force_registration=True) - self.config.register_guild( + self.config.register_global( channel = None, + gitea_url = None ) - @commands.command() - async def issuestest(self, ctx: commands.Context): - await ctx.message.reply(content="Hello world!", view=self.IssueButtons) + @app_commands.command() + async def issuestest(self, interaction: discord.Interaction): + await interaction.response.send_message(content="Hello world!", view=self.IssueButtons(), ephemeral=True) async def send_to_target(self, target: Union[discord.Member, discord.TextChannel], interaction: discord.Interaction, message: str, secondary_message: str = None): if isinstance(target, discord.Member): @@ -45,6 +46,9 @@ class Issues(commands.Cog): await interaction.response.send_modal(Issues.BotModal()) class BotModal(discord.ui.Modal, title="Creating issue..."): + def __init__(self): + super().__init__() + description = discord.ui.TextInput( label="Describe the bug", placeholder="A clear and concise description of what the bug is.",