forked from reznok/PugBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpugbot.py
30 lines (22 loc) · 843 Bytes
/
pugbot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import discord
import json
# Commands #
from commands.pug import pug
config = json.loads(open('config.json').read()) # Load Configs
DISCORD_TOKEN = config["discord_token"]
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
if message.content.startswith('!info') or message.content.startswith('!help'):
await client.send_message(message.channel, "I'm PugBot, the pug analyzer!\n"
"Use: !pug <name> <server> <region> \n"
"Example: !pug Basimot Lightbringer us")
if message.content.startswith('!pug'):
await pug(client, message)
client.run(DISCORD_TOKEN)