Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Vacation-chatbot/api.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (19 sloc)
813 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
client = discord.Client() | |
token = 'Nzc2ODIzNzU0MDA0NDk2NDQ1.X66ffw.XOxA0IHsRdEBjkyvThwCo-DTCCM' | |
#Lists | |
greetings1 = ['hi','hello','hey','what\'s up','good morning','good afternoon', 'good evening','whatup'] | |
responses1 = 'hey! hope you\'re having a good day, i\'m your your vacation chatbot, i will help you with finding holiday spot, let\'s start? ' | |
@client.event | |
async def on_ready(): | |
print('We have logged in as {0.user}'.format(client)) | |
@client.event | |
async def on_message(message): | |
messages = message.content.lower() | |
if message.author == client.user: | |
return | |
if messages in greetings1: | |
await message.channel.send(responses1) | |
elif type(messages) == int or float: | |
await message.channel.send('please dont use numbers') | |
client.run(token) |