Advertisement
OtsoSilver

Untitled

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