Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import random
- import discord
- client = discord.Client()
- @client.event
- async def on_ready():
- print("The bot is online!")
- await client.change_presence(game=discord.Game(name="Programming this bot!"))
- @client.event
- async def on_message(message):
- if message.author == client.user:
- return
- if message.content == "/help":
- await client.send_message(message.channel, "Commands:")
- await client.send_message(message.channel, "/help - displays this help context.")
- await client.send_message(message.channel, "/dice - rolls dice from 1-6")
- await client.send_message(message.channel, "/listserver or /ls")
- if message.content == "/dice":
- dice = random.randrange(1, 6)
- await client.send_message(message.channel,"**You throw the dice**")
- await client.send_message(message.channel,"The dices land on: " + str(dice) )
- if message.content == "/listserver" or message.content == "/ls":
- lsstatus = True if os.system("ping listserver.graal.in") is 0 else False
- if lsstatus == True:
- lsstatus = "Online"
- if lsstatus == False:
- lsstatus = "Offline"
- await client.send_message(message.channel,"Listserver status:")
- await client.send_message(message.channel,str(lsstatus))
- client.run("NTAyNTA4MzA1MDMwMTg0OTYy.DqqrQw.l45_iN-12bhrhiCgYMrXF6y63GA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement