mirror of
https://github.com/RGBCube/minearchy-bot
synced 2025-07-27 08:57:46 +00:00
Reorder misc.py
This commit is contained in:
parent
3813a869f7
commit
c6daaf386f
1 changed files with 25 additions and 25 deletions
|
@ -35,6 +35,17 @@ class Miscellaneous(
|
||||||
self.bot.help_command.cog = None
|
self.bot.help_command.cog = None
|
||||||
self.bot.help_command.hidden = True
|
self.bot.help_command.hidden = True
|
||||||
|
|
||||||
|
@command(brief="Hello!", help="Hello!")
|
||||||
|
async def hello(self, ctx: Context) -> None:
|
||||||
|
await ctx.reply(f"Hi {escape_markdown(ctx.author.name)}, yes the bot is running :)")
|
||||||
|
|
||||||
|
@command(
|
||||||
|
brief="Sends the total members in the server.",
|
||||||
|
help="Sends the total members in the server.",
|
||||||
|
)
|
||||||
|
async def members(self, ctx: Context) -> None:
|
||||||
|
await ctx.reply(f"There are `{ctx.guild.member_count}` users in this server.")
|
||||||
|
|
||||||
@command(brief="Sends the bots ping.", help="Sends the bots ping.")
|
@command(brief="Sends the bots ping.", help="Sends the bots ping.")
|
||||||
async def ping(self, ctx: Context) -> None:
|
async def ping(self, ctx: Context) -> None:
|
||||||
ts = ping_time()
|
ts = ping_time()
|
||||||
|
@ -54,25 +65,6 @@ class Miscellaneous(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@command(brief="Hello!", help="Hello!")
|
|
||||||
async def hello(self, ctx: Context) -> None:
|
|
||||||
await ctx.reply(f"Hi {escape_markdown(ctx.author.name)}, yes the bot is running :)")
|
|
||||||
|
|
||||||
@command(
|
|
||||||
brief="Sends the total members in the server.",
|
|
||||||
help="Sends the total members in the server.",
|
|
||||||
)
|
|
||||||
async def members(self, ctx: Context) -> None:
|
|
||||||
await ctx.reply(f"There are `{ctx.guild.member_count}` users in this server.")
|
|
||||||
|
|
||||||
@Cog.listener()
|
|
||||||
async def on_message(self, message: Message) -> None:
|
|
||||||
if not message.author.display_name.upper().startswith("[AFK]"):
|
|
||||||
return
|
|
||||||
|
|
||||||
await message.author.edit(nick=message.author.display_name[5:])
|
|
||||||
await message.channel.send(f"Welcome back {message.author.mention}! I've unset your AFK status.")
|
|
||||||
|
|
||||||
@command(
|
@command(
|
||||||
brief="Sets you as AFK.",
|
brief="Sets you as AFK.",
|
||||||
help="Sets you as AFK.",
|
help="Sets you as AFK.",
|
||||||
|
@ -93,14 +85,12 @@ class Miscellaneous(
|
||||||
await ctx.reply("Set your status to AFK. You can now touch grass freely 🌲.")
|
await ctx.reply("Set your status to AFK. You can now touch grass freely 🌲.")
|
||||||
|
|
||||||
@Cog.listener()
|
@Cog.listener()
|
||||||
async def on_message_delete(self, message: Message) -> None:
|
async def on_message(self, message: Message) -> None:
|
||||||
if not message.guild:
|
if not message.author.display_name.upper().startswith("[AFK]"):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.sniped[message.channel.id].appendleft((message, int(current_time())))
|
await message.author.edit(nick=message.author.display_name[5:])
|
||||||
|
await message.channel.send(f"Welcome back {message.author.mention}! I've unset your AFK status.")
|
||||||
while len(self.sniped[message.channel.id]) > 5:
|
|
||||||
self.sniped[message.channel.id].pop()
|
|
||||||
|
|
||||||
@command(
|
@command(
|
||||||
brief="Sends the latest deleted messages.",
|
brief="Sends the latest deleted messages.",
|
||||||
|
@ -154,6 +144,16 @@ class Miscellaneous(
|
||||||
|
|
||||||
await ctx.reply(embed=embed)
|
await ctx.reply(embed=embed)
|
||||||
|
|
||||||
|
@Cog.listener()
|
||||||
|
async def on_message_delete(self, message: Message) -> None:
|
||||||
|
if not message.guild:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.sniped[message.channel.id].appendleft((message, int(current_time())))
|
||||||
|
|
||||||
|
while len(self.sniped[message.channel.id]) > 5:
|
||||||
|
self.sniped[message.channel.id].pop()
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot: MinearchyBot) -> None:
|
async def setup(bot: MinearchyBot) -> None:
|
||||||
await bot.add_cog(Miscellaneous(bot))
|
await bot.add_cog(Miscellaneous(bot))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue