Git Product home page Git Product logo

cleverwrap.py's People

Contributors

edwardslabs avatar linuxdaemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cleverwrap.py's Issues

Doesn't respond to Japanese characters correctly

Cleverbot, when used through the web interface, responds to Japanese text with a message made in Japanese. When used through this library, however, Cleverbot responds in English, leading me to believe that the message is not getting sent correctly.

from cleverwrap import CleverWrap
cw = CleverWrap("token")
print(cw.say("こにちわ? なまいわ"))

Results in Cleverbot responding with an english phrase such as "Oh... Hi John!"

How to print the answer?

After cw.say("Hello CleverBot.") the script doesnt print me the answer
Which variable contain answer value?

Reply not present?

Hi Again,
I'm sorry to be here again, but the problem seems not fixed totally, so before coming i looked a bit in your code, and i edit those lines(87 & 88 - the lines that cause the error):

self.time_taken = int(reply.get("time_taken", None))
self.time_elapsed = int(reply.get("time_elapsed", None))

in:

time_taken_var = reply.get("time_taken", None)
time_elapsed_var = reply.get("time_elapsed", None)
try:
     self.time_taken = int(time_taken_var)
     self.time_elapsed = int(time_elapsed_var)
except ValueError:
     print("TIME TAKEN:" + str(time_taken_var))
     print("TIME ELAPSED:" + str(time_elapsed_var))

this try-except avoids the old error (ValueError) but then i noticed that when the error happens the clever doesn't give a reply, and return an empty string, this is why i tried:

while reply == "":
        reply = cw.say(nuovoMessaggio)
        print("Cleverbot Reply:" + reply)
        print("Reply:" + reply)

with this little control the error seems to never happens (try to yourself maybe?) so... maybe you should check if there is a reply and, if no, ask the cleverbot again? Something like that?
I'm not sure how your code works so it's just an idea...
Thanks for your support.
Bye

ADD new parameters.

you can now also pass in cb_settings_tweak1, cb_settings_tweak2 or cb_settings_tweak3 to vary how Cleverbot will respond

Cleverbot TypeError

When using the example code, the following error is thrown:

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    cw.say("Hello CleverBot.")
  File "C:\Users\Piero\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cleverwrap\cleverwrap.py", line 61, in say
    self._process_reply(reply)
  File "C:\Users\Piero\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cleverwrap\cleverwrap.py", line 84, in _process_reply
    self.count = int(reply.get("interaction_count", None))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

I'm using python 3, and I've set it to use my api key. Any idea what this is?

Strange Error

What could cause this error?
It started happening like a day ago and can't understand the cause

Ignoring exception in on_message
Traceback (most recent call last):
  File "[...]\Python\Python35\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)

  File "[...]/botLite.py", line 115, in on_message
    reply = cw.say(userMessage)

  File "[...]\Python\Python35\lib\site-packages\cleverwrap\cleverwrap.py", line 61, in say
    self._process_reply(reply)

  File "[...]\Python\Python35\lib\site-packages\cleverwrap\cleverwrap.py", line 83, in _process_reply
    self.count = int(reply.get("interaction_count", None))

ValueError: invalid literal for int() with base 10: ''

problems with cyrillic

Hi! When I write something in Russian to the bot like "привет" and it replies in Russian I get
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-3: ordinal not in range(256)
Old cleverbot package could work just fine with non-latin alphabets.
Thank you.

[Question] How to change the language

Hello again,

There is a way to change the language ? (because it's only english for the moment)
Maybe with an initial word such as "Holà" to enable Spanish or "привет" to enable Russian.

Any idea ?

JSON error? Invalid control character at line 1: column ...

Hi there, I recent just encountered a strange error when calling the say() function.
CleverWrap(bot.cleverbot_key).say(msg)

However it gaves us an error related to JSON. The backtrace is like:

/cleverwrap/cleverwrap.py, line 60, in say
reply = self._send(params)

/cleverwrap/cleverwrap.py, line 77, in_send
return r.json()

...(skipped)
builtins.ValueError: Invalid control character at: line 1 column number (char that number-1)

The skipped part if you are interested:

python3/dist-packages/requests/models.py, line 793 in json
return json.loads(self.text, **kwargs)

python3.4/json/__init__.py, line 318, in loads
return _default_decoder.decode(s)

python3.4/json/decoder.py
obj, end = self.raw_decode(s, idx=w(s, 0).end())

python3.4/json/decoder.py, line 359, in raw_decode
obj, end = self.scan_once(s, idx)

We don't see that error after restarting our app.
Also, unfortunately we can't see the JSON response when that error occurred.
Any ideas about this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.