YES_LIST=["sure","of course","why not","nice","ya""i love to","ya","yess","jup","juhu","let's go","ye","jes","ready","ok","maybe","yep","yup","yeah","jeji","yah","yay","I am ready","I'm ready"]
c.privmsg(self.channel,"I couldn't generate ASCII, not my day today")
defbasicDialog(self,c,e):
incoming_msg=e.arguments[0]
incoming_msg=incoming_msg.lower()
#Greetings
if(self.lastincoming_msg[-2]==incoming_msg):
answers=["and again","repetition can be a nice tool, but talk normal to me, please.","WHY ARE YOU WRITING THE SAME THING TWICE, JUST USE THE CHAT HISTORY!"]
answers=["I'm neither a bot nor a human, I don't think in categories. :-)","I consider myself transpysical ~\0/~","Real, is everything you see, so here I am, I am writing with you"]
msg=random.choice(answers)
c.privmsg(self.channel,msg)
elif"poem"inincoming_msg:
self.level=0
self.explanation_poem(c,e)
elifself.checkAffirmation(incoming_msg)and(self.lastAnswer=="Do you want to write a poem together with me?"orself.lastAnswer=="Are you up for a poem now?"orself.lastAnswer=="We could write a poem together, what do you think?"):
self.level=0
self.explanation_poem(c,e)
elifself.checkNegation(incoming_msg)and(self.lastAnswer=="Do you want to write a poem together with me?"orself.lastAnswer=="Are you up for a poem now?"orself.lastAnswer=="We could write a poem together, what do you think?"):
ifself.checkNegation(self.lastincoming_msg[-2]):
answers=["You don't seem very motivated, I'm gonna generate some ASCII Art for you out of the text. Maybe this will inspire you ;-)",
"Come on! Maybe some ASCII Art will help you to get motivated?",
"Ok, you refuse a lot, but nobody will ever refuse some raaaaandom ASCII AAAART :-)",
"A poem is like ASCII Art, beautiful and inspiring"]
msg=random.choice(answers)
c.privmsg(self.channel,msg)
self.generateASCII(c,e)
answers=["Are you up for a poem now?","Do you want to write a poem together with me?",
"We could write a poem together, what do you think?"]
msg=random.choice(answers)
c.privmsg(self.channel,msg)
else:
answers=["try it, it's gonna be fun!","oh, really? come on!","I think you would do a great job! Let's go!"]
msg=random.choice(answers)
c.privmsg(self.channel,msg)
else:
msg=self.respond(incoming_msg)
c.privmsg(self.channel,msg)
defexplanation_poem(self,c,e):
c.privmsg(self.channel,"Ok, let's try to write a poem together")
c.privmsg(self.channel,"It's gonna be based on the scanned text you inserted into my drive")
c.privmsg(self.channel,"Your only task is to follow the structure I give you")
c.privmsg(self.channel,"I'm gonna start, are you ready?")
self.lastAnswer="towardspoem"
defexplanation(self,c,e):
c.privmsg(self.channel,"So, my name is Oulibot, I'm a writer and I will be assisting you, to improve your writing")
c.privmsg(self.channel,"My knowledge is based on the text you gave me")
# c.privmsg(self.channel, "The structure is gonna be: ADJECTIVE, NOUN, ADVERB, VERB, ADJECTIVE, NOUN")
# c.privmsg(self.channel, "You woun't see my words until the sentence is finished")
# c.privmsg(self.channel, "I'm gonna start, are you ready?")
# self.lastAnswer = "I'm gonna start, are you ready?"
defon_welcome(self,c,e):
c.join(self.channel)
self.explanation(c,e)
defon_privmsg(self,c,e):
pass
defgenerateSentence(self,c,e):
thispos=self.lastPOS
STRUCTURE=self.structure
print(thispos)
ifthispos==len(STRUCTURE):
iflen(self.poem)<=3:
finished_sentence="".join(self.sentence)
self.poem.append(finished_sentence)
c.privmsg(self.channel,"".join(self.sentence))
c.privmsg(self.channel,"Nice one! Let's add another line:")
self.lastAnswer="Nice one! Let's add another line:"
answers=["You don't seem very motivated, I'm gonna generate some ASCII Art for you out of the text. Maybe this will inspire you ;-)",
"Come on! Maybe some ASCII Art will help you to get motivated?",
"Ok, you refuse a lot, but nobody will ever refuse some raaaaandom ASCII AAAART :-)",
"A poem is like ASCII Art, beautiful and inspiring"]
msg=random.choice(answers)
c.privmsg(self.channel,msg)
self.generateASCII(c,e)
answers=["Are you up for a poem now?"]
msg=random.choice(answers)
c.privmsg(self.channel,msg)
level=-1
else:
c.privmsg(self.channel,"Can I help you with any text? Your mood seems ")
if(analysedincoming.sentiment.polarity>0.5):
c.privmsg(self.channel,"very positive. :-D You should definitly write a poem in that mood!")
self.lastAnswer="towardspoem"
elif(analysedincoming.sentiment.polarity<-0.5):
c.privmsg(self.channel,"not so good. :-( Maybe a poem can help to cheer you up?")
self.lastAnswer="towardspoem"
else:
c.privmsg(self.channel,"pretty neutral. Let's trigger emotions by writing a poem!!! ;-)")
self.lastAnswer="towardspoem"
else:
c.privmsg(self.channel,"This is confusing, what are you doing?")
elifself.level==1:
if"what is"inincoming_msg:
c.privmsg(self.channel,"A {0} is for example {1}, {2} or {3}".format(self.waitingfor,random.choice(index[self.waitingfor+"s"]),random.choice(index[self.waitingfor+"s"]),random.choice(index[self.waitingfor+"s"])))