async def cat(self, ctx): """Sends a random cute cat gif because cats are soooo cuteeee <3 >.<""" await self.bot.send_typing(ctx.message.channel) cat.getCat(directory="data", filename="cat", format="gif") await asyncio.sleep( 1) # This is so the bot has enough time to download the file await self.bot.send_file(ctx.message.channel, "data/cat.gif")
async def cat(self, ctx): """Sends a random cute cat gifs because cats are soooo cuteeee <3 >.< -Seth, 2016""" await ctx.channel.trigger_typing() cat.getCat(directory="data", filename="cat", format="gif") await asyncio.sleep( 1) # This is so the bot has enough time to download the file await ctx.send(file=discord.File("data/cat.gif"))
async def cat(self, ctx): """Sends a random cute catto gif because cats are soooo cuteeee <3 >.<""" # Watch Nero spam this command until the bot crashes await ctx.channel.trigger_typing() cat.getCat(directory="data", filename="cat", format="gif") await asyncio.sleep(1) # This is so the bot has enough time to download the file await ctx.send(file=discord.File("data/cat.gif", "cat.gif"))
def getImage(self, name = None): if name == None : self.name = self.getTimeStamp() cat.getCat(directory=self.path, filename=self.name, format=self.format) else: self.name = name self.img = Image.open(self.name+'.'+self.format) self.width, self.heigth = self.img.size
async def cat(self, ctx): pic = random.randint(0, 1) channel = ctx.message.channel x = cat.getCat(directory=None, filename=None, format='{}'.format(self.type[pic])) with open(x, 'rb') as f: await self.bot.send_file(channel, f)
def send_cat(self, thread_id, thread_type): img = cat.getCat(directory=None, filename='cat', format='jpg') self.sendLocalImage(img, message=None, thread_id=thread_id, thread_type=thread_type)
def getImage(self): self.name = self.getTimeStamp() cat.getCat(directory=self.path, filename=self.name, format=self.format) self.img = Image.open(self.name + '.' + self.format) self.width, self.heigth = self.img.size
async def cat(self, ctx): """Sends a random cute cat gifs because cats are soooo cuteeee <3 >.<""" await self.bot.send_typing(ctx.message.channel) cat.getCat(directory="data", filename="cat", format="gif") await asyncio.sleep(1) # This is so the bot has enough time to download the file await self.bot.send_file(ctx.message.channel, "data/cat.gif")
import cat import os from random import random HERE = os.getcwd() catfilename = str(int(100 + (random() * 899))) c = cat.getCat(directory=HERE, filename=catfilename, format='png') print(c)