Skip to main content

Easy chatbot development with Python. Create your own chatbots with just a few lines of code.

Project description

BotCreator by EdexCode

Easy chatbot development with Python. Create your own chatbots with just a few lines of code.

How To Use?

Syntax

Python

import botcreator as bc

bc.filename = 'TXT_FILE_PATH'
prompt = input("Prompt: ")
print(bc.botresponse(prompt.lower()))

TXT File

hi#hello/Hi there!

Symbols

1. / - Separator or Divider:

Separates the expected prompt (or conditions) from the response. It divides the rule into two parts: what the bot should recognize or react to (left side) and how it should respond (right side).

Example:

hi/Hi there!

Here, 'hi' represents condition or expected input, and 'Hi there' represents response. The / separates the conditions from the responses.

2. # - OR Operator:

Indicates multiple possible responses within a single rule. When used after a response, it signifies that the bot can randomly select one of the responses listed.

Example:

hi#hello#sup/Hi there#How can I help you

Here, The # symbol in the rule hi#hello#sup/Hi there#How can I help you separates multiple alternative inputs (hi, hello, sup), indicating that the bot should respond to any of these inputs with randomly chosen responses (Hi there or How can I help you).

3. # - AND Operator:

Connects multiple conditions within the expected prompt. It indicates that all specified conditions must be present for the rule to trigger a response.

NOTE: Only works in expected prompt (or condition)

Example:

my&name&is/Nice to meet you!

Here, The & symbol in my&name&is/Nice to meet you! signifies that the bot expects all three words (my, name, is) to appear together in the user's input. When this condition is met, the bot will respond with Nice to meet you!.

Example

words.txt

my&name&is/Nice to meet you!
hi#hello#sup/Hi there#How can i help you?
are&you&a&bot#your&a&chatbot/Yes
&help/How can i help you?

main.py

import botcreator as bc

bc.filename = 'words.txt'
prompt = input("Prompt: ")
print(bc.botresponse(prompt.lower()))

Outputs:

my&name&is/Nice to meet you!

Prompt: my name is edex
Nice to meet you!

hi/hello/sup/Hi there#How can i help you?

Prompt: hi
Hi there
Prompt: hello
How can i help you?
Prompt: sup
How can i help you?

are&you&a&bot#your&a&chatbot/Yes

Prompt: are you a bot?
Yes
Prompt: your a chatbot
Yes

&help/How can i help you?

Prompt: can you help me
How can i help you?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botcreator-0.0.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

botcreator-0.0.3-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file botcreator-0.0.3.tar.gz.

File metadata

  • Download URL: botcreator-0.0.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for botcreator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 295c889850ca35410fd942b223bc268438ae0e91a4c2037179c32638baa09e08
MD5 6c7f5ef547f279625b56879aefa93c44
BLAKE2b-256 ac05ead81ea4d4f1403fb21dd3fdac4489cf40d493d60b22ede43df2c34f5f9d

See more details on using hashes here.

File details

Details for the file botcreator-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: botcreator-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.14

File hashes

Hashes for botcreator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04f63a8765363acdc52f1bec53c79ba199351b862a684654edef5ff7393a2e0b
MD5 bb210fab48d611d1edaacff8647c5284
BLAKE2b-256 d501374552abce87a50df9764c28dcf7159a0fbab657b4cc816256182872ecf7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page