Пример #1
0
 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")
Пример #2
0
 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"))
Пример #3
0
 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"))
Пример #4
0
 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"))
Пример #5
0
    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
Пример #6
0
 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)
Пример #7
0
 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)
Пример #8
0
    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
Пример #9
0
 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")
Пример #10
0
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)