Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
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') |