-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
46 lines (35 loc) · 1.03 KB
/
bot.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from dotenv import load_dotenv
import global_vars as bf
import discord
import requests
import asyncio
import main
import os
load_dotenv()
client = discord.Client()
bot = os.getenv('bot_token')
############ Bot Keywords
search = '$run'
help = '$help'
bourbon = '$bourbon'
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
if message.content.startswith('$run'):
await message.channel.send('Search has started...')
await main.run()
if message.content.startswith('$stop'):
bf.isSearching = False
await message.channel.send('Shutting down search...')
if message.content.startswith('$help'):
await message.channel.send(
'List of commands: '
'\n\t$run_search to start searching for bourbon'
'\n\t$blanton ...')
client.run(bot)