Mercurial > codedump
changeset 19:bab0727f84f6
Add files via upload
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Fri, 09 Apr 2021 21:43:22 -0400 |
parents | 916bab9ae217 |
children | dfdb15d3caef |
files | randomimageposter.py |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/randomimageposter.py Fri Apr 09 21:43:22 2021 -0400 @@ -0,0 +1,18 @@ +import glob, os, random, discord +from discord.ext import commands + +client = commands.Bot(command_prefix = '!!') + +@client.event +async def on_ready(): + print("Ready!") + +@client.command() +async def random(ctx): + files = glob.glob("*.png") + files.extend(glob.glob("*.jpg")) + files.extend(glob.glob("*.gif")) + file = random.choice(files) + await ctx.send(file=discord.File(file)) + +client.run("PUT TOKEN HERE") \ No newline at end of file