Skip to content
Permalink
c6034d3ffb
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
64 lines (40 sloc) 2 KB
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '.')
@client.event
async def on_ready():
print("Bot Ready.") #check if the bot is ready
QuestionCount = 0
PhoneBudget = ''
PhoneSize = ''
PhoneCamera = ''
PhoneBattery = ''
PhoneBrand = ''
@client.event
async def on_message(message):
global QuestionCount #current question number
if message.author == client.user and not message.guild: #prevent bot from replying to itself
return
#await message.channel.send('check' + str(QuestionCount))
if QuestionCount==0: #The bot only replies to DMs
await message.channel.send('Welcome! I am Mr SmartBOT here. You have come to the right place to choose your next ideal smartphone!')
QuestionCount = QuestionCount + 1
elif QuestionCount == 1:
await message.channel.send('What is the maximum amount of money you would like to spend on your next smartphone?')
QuestionCount = QuestionCount + 1
elif QuestionCount == 2:
QuestionCount = QuestionCount + 1
await message.channel.send('Do you prefer a large phone or do you prefer something compact?')
elif QuestionCount == 3:
QuestionCount = QuestionCount + 1
await message.channel.send('Do you use your phone for professional photography?')
elif QuestionCount == 4:
QuestionCount = QuestionCount + 1
await message.channel.send(''''For approximately how many hours do you daily use your phone for? (4 hours of screen-on time is the average)''')
elif QuestionCount == 5:
QuestionCount = QuestionCount + 1
await message.channel.send('Which of the following brand do you prefer Apple,Samsung, Google or OnePlus?')
elif QuestionCount == 6:
QuestionCount = 0
await message.channel.send("Thanks. That's all I need to know.")
client.run('NzgwODc2MDg2NzExNTUwMDEz.X71dhw.opqQ5muiGjKydgThgPthqXyq1Ss')