24 lines
692 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import discord
from discord.ext import commands
from utils.cat import fetch_cat
class Cat(commands.Cog):
"""Команда !cat — случайный котик"""
@commands.command(name="cat")
async def cat(self, ctx):
"""Получить случайного котика"""
url = await fetch_cat()
if url is None:
await ctx.send("Не удалось получить котика. Попробуйте позже.")
return
embed = discord.Embed(
title="Котик для тебя!",
color=discord.Color.orange()
)
embed.set_image(url=url)
await ctx.send(embed=embed)