|
|
@@ -1,5 +1,6 @@
|
|
|
from discord.ext import commands
|
|
|
import discord
|
|
|
+from discord import app_commands
|
|
|
import time
|
|
|
from typing import Optional
|
|
|
from query.channel import get_interact
|
|
|
@@ -8,11 +9,6 @@ from common.logging import report
|
|
|
from local_settings import OUTPUT_CHANNEL
|
|
|
from common.settings import check_ignore
|
|
|
|
|
|
-
|
|
|
-async def setup(bot: commands.Bot):
|
|
|
- await bot.add_cog(GeneralCommands(bot))
|
|
|
-
|
|
|
-
|
|
|
class GeneralCommands(commands.Cog):
|
|
|
"""General functionality."""
|
|
|
|
|
|
@@ -104,20 +100,36 @@ class GeneralCommands(commands.Cog):
|
|
|
await ctx.send(f"I shall now interact with you again where my channel settings allow it.")
|
|
|
await report(self.bot, f"`{ctx.author}` has requested to be un-ignored.")
|
|
|
|
|
|
- @commands.command(
|
|
|
- description="Ignore status for user.",
|
|
|
- brief="Check if user is ingored",
|
|
|
- help="Verify if the user is being ignored."
|
|
|
+ @app_commands.command(
|
|
|
+ name="isignored1",
|
|
|
+ description="Echoes a message."
|
|
|
)
|
|
|
- async def isignored(self, ctx: commands.Context, user: Optional[discord.User]):
|
|
|
+ # @commands.command(
|
|
|
+ # description="Ignore status for user.",
|
|
|
+ # brief="Check if user is ingored",
|
|
|
+ # help="Verify if the user is being ignored."
|
|
|
+ # )
|
|
|
+ async def isignored1(self, interaction: discord.Interaction, user: Optional[discord.User]):
|
|
|
+ print(0)
|
|
|
# Halt on ignore list.
|
|
|
- if await check_ignore(self.bot.pg, ctx.author):
|
|
|
+ if await check_ignore(self.bot.pg, interaction.author):
|
|
|
+ print("Ignoring")
|
|
|
return
|
|
|
|
|
|
if not user:
|
|
|
- user = ctx.author
|
|
|
+ user = interaction.author
|
|
|
|
|
|
if await is_ignored(self.bot.pg, user.id):
|
|
|
- await ctx.send(f"I am ingoring `{user}`.")
|
|
|
+ await interaction.response.send_message(f"I am ignoring `{user}`.")
|
|
|
+ print(1)
|
|
|
else:
|
|
|
- await ctx.send(f"I am not ignoring `{user}`.")
|
|
|
+ await interaction.response.send_message(f"I am not ignoring `{user}`.")
|
|
|
+ print(2)
|
|
|
+
|
|
|
+ @app_commands.command(name="echo1", description="Echo a message")
|
|
|
+ async def echo1(self, inter: discord.Interaction, message: str) -> None:
|
|
|
+ await inter.response.send_message(message)
|
|
|
+
|
|
|
+
|
|
|
+async def setup(bot: commands.Bot):
|
|
|
+ await bot.add_cog(GeneralCommands(bot))
|