KiTTY, un bot Discord qui est un petit chat :) Il est basé sur une ancienne version du bot Red, sous Python 3.6 et qui a des fonctionnalités bien sympatiques !
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

32 lines
848B

  1. from discord.ext import commands
  2. from cogs.utils.chat_formatting import box
  3. try:
  4. from pyfiglet import figlet_format
  5. except:
  6. figlet_format = None
  7. class Ascii(object):
  8. def __init__(self, bot):
  9. self.bot = bot
  10. @commands.command(name="ascii")
  11. async def _ascii(self, *, text):
  12. try:
  13. msg = str(figlet_format(text, font='cybermedium'))
  14. if msg[0] == " ":
  15. msg = "." + msg[1:]
  16. error = figlet_format("Too long !",
  17. font='cybermedium')
  18. if len(msg) > 2000:
  19. await self.bot.say(box(error))
  20. else:
  21. await self.bot.say(box(msg))
  22. except Exception as e:
  23. await self.bot.say("Don't use emojis :cat:, and/or accents")
  24. def setup(bot):
  25. n = Ascii(bot)
  26. bot.add_cog(n)