Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
7

Chat Bot

-g
-g
5 years ago

Voters

Comments

TopNew
1
0
trustmethisismy
trustmethisismy

For your if q == "string" code, try doing:
if q.lower() == "string":

The q.lower() changes the user input to lower case, so that means you don't have to stress about checking both upper case and lower case inputs.


Another way you could simplify your code is if you did:
if "string" in q.lower():

No matter what the input, if the input has the string in it, it will activate (e.g. I want to string, I want to string pls, DAJAStringasdaisjisadfjaf)

5 years ago
0
-g
-g

@trustmethisismy
: thanks, I have improved my chatbot now

5 years ago
0
LardBoi
LardBoi

this is actually pretty good. Just make a /clear function that clears the screen of text. I'm a c++ person but do know some python from what i know I'm pretty sure it's possible I don't know online though. See if you can figure it out.

5 years ago
0
trustmethisismy
trustmethisismy

@lardboi
:

import replit
replit.clear()

5 years ago
Load more