I am creating a feature in my chat bot that change the bot agent name. I declare the bot name at the top.
bot = "Bot"
Than i create a function that take input from user and change name of the bot
elif "c-a" in inp:
settt = True
print(f"Choose agent(1-7):", end=' ')
while settt:
s_c = input()
try:
s = int(s_c)
except ValueError:
s = str(s_c)
sv = type(s)
if sv is int:
if s == 1:
bot = "Bhaskar"
return bot
elif s == 2:
bot = "Divya"
return bot
elif s == 3:
bot = "Nayan"
return bot
elif s == 4:
bot = "Sruti"
return bot
elif s == 5:
bot = "Gagan"
return bot
elif s == 6:
bot = "Ruchi"
return bot
elif s == 7:
bot = "Abhishek"
return bot
else:
a()
print("I didn't get it. Chose between 1 to 7 or type /h for help & /q for discard")
q()
else:
if s == "/h":
bot_list()
elif s == "/q":
settt = False
else:
a()
print("I didn't get it. Chose between 1 to 7 or type /h for help & /q for discard")
q()
But bot value remains same. it will not changed.
Aucun commentaire:
Enregistrer un commentaire