Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. import os
  2. import random
  3. import discord
  4.  
  5. client = discord.Client()
  6. @client.event
  7. async def on_ready():
  8.     print("The bot is online!")
  9.     await client.change_presence(game=discord.Game(name="Programming this bot!"))
  10.  
  11. @client.event
  12. async def on_message(message):
  13.     if message.author == client.user:
  14.         return
  15.     if message.content == "/help":
  16.         await client.send_message(message.channel, "Commands:")
  17.         await client.send_message(message.channel, "/help - displays this help context.")
  18.         await client.send_message(message.channel, "/dice - rolls dice from 1-6")
  19.         await client.send_message(message.channel, "/listserver or /ls")
  20.     if message.content == "/dice":
  21.         dice = random.randrange(1, 6)
  22.         await client.send_message(message.channel,"**You throw the dice**")
  23.         await client.send_message(message.channel,"The dices land on: " + str(dice) )
  24.     if message.content == "/listserver" or message.content == "/ls":
  25.         lsstatus = True if os.system("ping listserver.graal.in") is 0 else False
  26.         if lsstatus == True:
  27.             lsstatus = "Online"
  28.         if lsstatus == False:
  29.             lsstatus = "Offline"
  30.         await client.send_message(message.channel,"Listserver status:")
  31.         await client.send_message(message.channel,str(lsstatus))
  32.  
  33. client.run("NTAyNTA4MzA1MDMwMTg0OTYy.DqqrQw.l45_iN-12bhrhiCgYMrXF6y63GA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement