Advertisement
OtsoSilver

Untitled

Dec 18th, 2021
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.33 KB | None | 0 0
  1. import random
  2. from ramapi import *
  3. import asyncio
  4. from discord.ext import  commands
  5. from credits import token, ttt
  6. bot = commands.Bot(command_prefix="!")
  7. games = {"Action": ["Tomb Rider", "CS:GO"], "Strategy": ["Civilization", "Dota 2"]}
  8. # @bot.event
  9. # async  def on_message(message):
  10. #     if message.content == "Привет":
  11. #         await message.channel.send("ДАРОВА КАК ЖИТУХА БРАТУХА??")
  12. #     if message.content == "Почему мой бот не работает?":
  13. #         await message.channel.send("ЧЕ с дуба рухнул вот же я пишу")
  14. #     new_mes = message.content.lower().split(" ")
  15. #     if 'игра' or 'игр' or 'игры' or 'игру' in new_mes:
  16. #         await  message.channel.send("Кто то сказал игра? Так давай сыграем?")
  17. # @bot.event
  18. # async def on_message(message):
  19. #     if message.content.startswith("Привет"):
  20. #         await message.reply("Рад тебя видеть снова!", mention_author = True)
  21.  
  22. @bot.command(name="info")
  23. async def info(ctx):
  24.     await ctx.send(":joy: Создатель этого бота OtsoSilver#8291 :joy:")
  25.  
  26. @bot.command(name = "play")
  27. async def play(ctx, type_name):
  28.     game = games[type_name]
  29.  
  30.     await ctx.send(f"Вы хотите сыграть в {game[random.randint(0,1)]}")
  31.  
  32. @bot.command(name='timer')
  33. async def timer(ctx, number):
  34.     number = int(number)
  35.     message = await ctx.send(number)
  36.     while number != 0:
  37.         number -=1
  38.         await  message.edit(content = number)
  39.         await asyncio.sleep(1)
  40.     await  message.edit(content = "Ended!!!")
  41.  
  42. @bot.command(name = 'remind')
  43. async def remind(ctx, *args):
  44.     await asyncio.sleep(int(args[-1]))
  45.     await ctx.send(' '.join(args[0:-1]))
  46.  
  47. @bot.command("find_rick")
  48. async def find_rick(ctx):
  49.     data =  Character.filter(name = "Rick Sanchez")
  50.     otvet = ''
  51.     for character in data['results']:
  52.         otvet += f'```Имя: {character["name"]} \n'
  53.         otvet += f'Вид: {character["species"]} \n'
  54.         otvet += f'Статус: {character["status"]} \n'
  55.         otvet += f'Место рождения: {character["origin"]["name"]} \n'
  56.         otvet += f'Место нахождения: {character["location"]["name"]} \n```'
  57.         await ctx.send(otvet)
  58.         otvet = ''
  59.  
  60.  
  61.  
  62.  
  63. bot.run(token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement