From 98c33c83e726ed032a4ebf40e0991d764a0477c7 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 23 Jul 2020 22:47:12 +0100 Subject: [PATCH] someone command allows for a random person in the server to be tagged --- main.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 69a5b302..0f3a6566 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ import asyncio import datetime +import random from contextlib import closing from typing import Optional @@ -8,7 +9,7 @@ import mariadb from decouple import config from discord import Embed from discord.ext import commands, tasks -from discord.ext.commands import when_mentioned_or, is_owner, guild_only, has_permissions +from discord.ext.commands import when_mentioned_or, is_owner, guild_only, has_permissions, cooldown, BucketType import db import settings @@ -167,6 +168,15 @@ async def leave(ctx): await ctx.guild.leave() +@client.command() +@guild_only() +@cooldown(1, 300, BucketType.guild) +async def someone(ctx): + """Tags Someone Randomly in the Server""" + + await ctx.send(random.choice(tuple(member.mention for member in ctx.guild.members if not member.bot))) + + @client.command(name='help') async def _help(ctx, *, command: str = None): """Shows help about a command or the bot"""