diff --git a/SmartBOT.py b/SmartBOT.py new file mode 100644 index 0000000..c617161 --- /dev/null +++ b/SmartBOT.py @@ -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')