1
Fork 0
mirror of https://github.com/RGBCube/minearchy-bot synced 2025-07-27 08:57:46 +00:00

Add =members

This commit is contained in:
RGBCube 2022-07-25 15:19:23 +03:00
parent 95da9e096b
commit 49cd00fa79

View file

@ -15,9 +15,9 @@ if TYPE_CHECKING:
from bot import MinearchyBot from bot import MinearchyBot
class Miscellanious( class Miscellaneous(
commands.Cog, commands.Cog,
name="Miscellanious", name="Miscellaneous",
description="Various utilities.", description="Various utilities.",
): ):
def __init__(self, bot: MinearchyBot) -> None: def __init__(self, bot: MinearchyBot) -> None:
@ -64,6 +64,13 @@ class Miscellanious(
async def count(self, ctx: commands.Context) -> None: async def count(self, ctx: commands.Context) -> None:
await ctx.reply(f"Currently in `{len(self.bot.guilds)}` servers.") await ctx.reply(f"Currently in `{len(self.bot.guilds)}` servers.")
@commands.command(
brief="Sends the total members in the server.",
help="Sends the total members in the server.",
)
async def members(self, ctx: commands.Context) -> None:
await ctx.reply(f"There are `{ctx.guild.member_count}` users in this server.")
@commands.Cog.listener() @commands.Cog.listener()
async def on_message_delete(self, message: discord.Message) -> None: async def on_message_delete(self, message: discord.Message) -> None:
if not message.guild: if not message.guild:
@ -129,4 +136,4 @@ class Miscellanious(
async def setup(bot: MinearchyBot) -> None: async def setup(bot: MinearchyBot) -> None:
await bot.add_cog(Miscellanious(bot)) await bot.add_cog(Miscellaneous(bot))