Mercurial > codedump
view randomimageposter.py @ 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 | |
children | 358cad883bc3 |
line wrap: on
line source
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")