Giter Site home page Giter Site logo

cmdbot's People

Contributors

brunobord avatar chassing avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

kyleterry phreeza

cmdbot's Issues

Brain should have a "do you know that" mechanism

the if hasattr() method looks ugly. Maybe we should add a method to the "brain" object that indicates if the Brain knows.

Something like:

if self.brain.knows('number_of_stuff'):
    self.say("something else")

a "quit" command?

a command to make the bot leave, disconnect. don't know if it's valuable.

better doc: readthedocs.org?

Why not having a nice Sphinx-based readthedocs documentation?

at least 2 sections:

  • usage
  • make a brainier bot (doc for devs)

i18n: translate strings

At least the "said" messages.

  • Make them translatable.
  • make the french translation
  • provide a simple way to build extended brainybots with i18n (doc)

using setup.py or pip, locale should be loaded

looks like locale dirs aren't loaded when installed via setup.py or pip install.
pretty painful, it looks like you have to copy all of them in the right directory, and load it via gettext afterwards.
and I thought it was fun...

a more clever "run"

the main run depends way too much on the "bot.ini" file. We need it to be more hidden underneath the run() method, that should parse arguments, load configuration, etc.

bad encoding handling...

My bot has read an IRC line in #django-fr and has fumbled, because of a bad encoding error. Need more security around encodings.

looks like @admin decorator doesn't work

the line is fully interpreted, but the admin decorator doesn't return the command if the nick is in the admin.

BTW, having a summary of the configuration can't be a bad thing on startup...

the "noverb" action

need a function that triggers whenever cmdbot is receiving a line, that just does "pass", and that a developer can override to fit its needs.

or maybe a decorator to tell cmdbot to execute a series of actions.

Command aliases

aliases for commands. "ร  la" cmd, probably. Need docs.

planned tasks

decorate some tasks that would be executed under certain conditions (what time/day it is, for a start)

Property "no_help"

Do not display help for "hidden" commands. they wont appear in "help" and you can't make "help "

logging level at the bot level

The logging is set in the core module. Bad. Should be able to set a logging from the Bot itself, to adjust the logging level.

UnicodeDecodeError

This is probably just an error with my setup, but I got this error on a pretty default setup of ircd-hybrid.

INFO:root:Translation Not Found. Fallback to default
INFO:root:Connection to host...
Connection to host...
Traceback (most recent call last):
File "./eightball.py", line 33, in
bot.run()
File "/home/bot/env/lib/python2.7/site-packages/cmdbot/core.py", line 177, in run
readbuffer = readbuffer + self.s.recv(1024).decode('utf8')
File "/home/bot/env/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 1023: unexpected end of data

I was able to get the bot to work though by changing line 177 of cmdbot/core.py to the following

try:
    readbuffer = readbuffer + self.s.recv(1024).decode('utf')
except UnicodeDecodeError:
    continue

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.