Code Monkey home page Code Monkey logo

nemubot's People

Contributors

bcournaud avatar colona avatar nbr23 avatar nemunaire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nemubot's Issues

Birthday modules fail after redefinition

Chaîne reconnue : 11/8/1912 None:None:None
[birthday] Saving!
ERROR: occurred during the processing of the message: b':[email protected] PRIVMSG #*** :!anniv'
Traceback (most recent call last):
  File "/home/nemunaire/nemubot/server.py", line 234, in treat_msg
    msg.treat (self.mods)
  File "/home/nemunaire/nemubot/message.py", line 154, in treat
    self.parsemsg (mods)
  File "/home/nemunaire/nemubot/message.py", line 301, in parsemsg
    if im.has_access(self) and im.parseanswer(self):
  File "/home/nemunaire/nemubot/modules/birthday.py", line 48, in parseanswer
    tyd = DATAS.index[name].getDate("born")
AttributeError: 'datetime.datetime' object has no attribute 'getDate'```

!météo timezone

The time used in the !meteo module should probably be the local time of queried country/city.

!imdb feature

Add a new !imdb command.
It should be possible to specify what type of information we want:
!imdb fringe year
!imdb fringe seasons
or else, which gives specific information. When no parameter is specified, it should just answer with the short description of the movie (or series or actor).

!42 highscore

Record an history of the n highest winning scores for the 42 game and display it with !42 highscore or !42 scoreboard.

Add listing of available/implemented commands

Document the different commands each module (and the core?) provides, as well as a short description, and provide a !help or similar to list the commands available and their description

[v4] subshells

Reinterpret and substitute commands in `` (or $(), or whatever) as new commands.
ex:

!wa !wa 42+1337km to newton²
!météo !wa gps coordinates Saint-Amant-sur-Fion
!startsms "bus: !ratp 131 "Les Dalias" "Porte d'Italie"" 30m

Use Python decorators for registering hooks

Currently, to add a hook, we have to create a Hook and call the magic add_hook with cryptic parameters.

For static hooks (not defined by users through the module), a more simple syntax should be usable, based on Python decorators:

    @hook(type="im_cmd", help="say hello to the user")
    def hello(msg):
        return Message("Hello " + msg.sender)

Wikipedia module sometimes fails

There are some major issues on some wikipedia requests, for example: "!w phobos (lune)", which does not give the expected answer but "{{Planète mineure court" instead.

Backtrace on !unwatch

ERROR: occurred during the processing of the message: b':someone![email protected] PRIVMSG #channel :!unwatch url://\r'
Traceback (most recent call last):
File "/home/nemunaire/workspace/nemubot/consumer.py", line 90, in run
res = self.treat_in(context, msg)
File "/home/nemunaire/workspace/nemubot/consumer.py", line 51, in treat_in
return context.treat_irc(msg, self.srv)
File "/home/nemunaire/workspace/nemubot/bot.py", line 380, in treat_irc
res = h.run(msg, srv, msg.cmd)
File "/home/nemunaire/workspace/nemubot/hooks.py", line 206, in run
return call(msg, data2)
File "/home/nemunaire/workspace/nemubot/bot.py", line 446, in treat_prvmsg
return self.treat_cmd(msg, srv)
File "/home/nemunaire/workspace/nemubot/bot.py", line 466, in treat_cmd
res = h.run(msg, strcmp=msg.cmds[0])
File "/home/nemunaire/workspace/nemubot/hooks.py", line 202, in run
return call(msg)
File "/home/nemunaire/workspace/nemubot/modules/watchWebsite/init.py", line 72, in del_site
del_event(site["_evt_id"])
File "/home/nemunaire/workspace/nemubot/importer.py", line 159, in
module.del_event = lambda evt: self.context.add_event(evt, module_src=module)
File "/home/nemunaire/workspace/nemubot/bot.py", line 115, in add_event
now.second)
AttributeError: 'str' object has no attribute 'id'

New command !owner

This command should answer which user created it (many modules has to be asked).
A fallback message could be sent if no module catch the command.

Add a way to execute two or more commands in one line

For example:
!goûter and !google

Perhaps: !some ; cmd1;cmd2 or !cmds ; cmd1;cmd2
With first arg: the separator.
All others args are grouped (merge spaces), then splitted with the separator.

If the first arg is longer than one character, assume we are in a special case where the separator is the space character: !cmds !google !goûter.

cmd_server: context decorator

In prompt, context (use of SELECT command) can be given as first argument.

As code is duplicated between function, using a decorator could avoid duplication.

!startsms

Combine !start and !sms, send an !sms when the !start times out.

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.