Replace help_tiny by module docstring
This commit is contained in:
parent
e5ec487d29
commit
cd7843e16e
2
bot.py
2
bot.py
@ -608,7 +608,7 @@ def _help_msg(sndr, modules, cmd):
|
|||||||
res.append_message(title="Pour plus de détails sur un module, "
|
res.append_message(title="Pour plus de détails sur un module, "
|
||||||
"envoyez \"!help nomdumodule\". Voici la liste"
|
"envoyez \"!help nomdumodule\". Voici la liste"
|
||||||
" de tous les modules disponibles localement",
|
" de tous les modules disponibles localement",
|
||||||
message=["\x03\x02%s\x03\x02 (%s)" % (im, modules[im].help_tiny ()) for im in modules if hasattr(modules[im], "help_tiny")])
|
message=["\x03\x02%s\x03\x02 (%s)" % (im, modules[im].__doc__) for im in modules if modules[im].__doc__])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def hotswap(bak):
|
def hotswap(bak):
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Create alias of commands"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -19,10 +21,6 @@ def load(context):
|
|||||||
DATAS.getNode("variables").setIndex("name")
|
DATAS.getNode("variables").setIndex("name")
|
||||||
|
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "alias module"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "TODO"
|
return "TODO"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""People birthdays and ages"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -15,11 +17,6 @@ def load(context):
|
|||||||
DATAS.setIndex("name", "birthday")
|
DATAS.setIndex("name", "birthday")
|
||||||
|
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "People birthdays and ages"
|
|
||||||
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!anniv /who/: gives the remaining time before the anniversary of /who/\n!age /who/: gives the age of /who/\nIf /who/ is not given, gives the remaining time before your anniversary.\n\n To set yout birthday, say it to nemubot :)"
|
return "!anniv /who/: gives the remaining time before the anniversary of /who/\n!age /who/: gives the age of /who/\nIf /who/ is not given, gives the remaining time before your anniversary.\n\n To set yout birthday, say it to nemubot :)"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Wishes Happy New Year when the time comes"""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from hooks import hook
|
from hooks import hook
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Find french conjugaison"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
@ -28,9 +30,6 @@ d = defaultdict(list)
|
|||||||
for k, v in s:
|
for k, v in s:
|
||||||
d[k].append(v)
|
d[k].append(v)
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
return "Find french conjugaison"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!conjugaison <tens> <verb>: give the conjugaison for <verb> in <tens>."
|
return "!conjugaison <tens> <verb>: give the conjugaison for <verb> in <tens>."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Search around various search engine or knowledges database"""
|
||||||
|
|
||||||
import imp
|
import imp
|
||||||
|
|
||||||
from hooks import hook
|
from hooks import hook
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Create countdowns and reminders"""
|
||||||
|
|
||||||
import imp
|
import imp
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@ -14,10 +16,6 @@ nemubotversion = 3.4
|
|||||||
from event import ModuleEvent
|
from event import ModuleEvent
|
||||||
from hooks import Hook, hook
|
from hooks import Hook, hook
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "events manager"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "This module store a lot of events: ny, we, " + (", ".join(DATAS.index.keys())) + "\n!eventslist: gets list of timer\n!start /something/: launch a timer"
|
return "This module store a lot of events: ny, we, " + (", ".join(DATAS.index.keys())) + "\n!eventslist: gets list of timer\n!start /something/: launch a timer"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Repositories, users or issues on GitHub"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import urllib.error
|
import urllib.error
|
||||||
@ -10,10 +12,6 @@ from hooks import hook
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "The GitHub module"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "!github /repo/: Display information about /repo/.\n!github_user /user/: Display information about /user/."
|
return "!github /repo/: Display information about /repo/.\n!github_user /user/: Display information about /user/."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Show many information about a movie or serie"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import urllib.request
|
import urllib.request
|
||||||
@ -8,9 +10,6 @@ from hooks import hook
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
return "Show many information about a movie or serie"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "Search a movie title with: !imdbs <approximative title> ; View movie details with !imdb <title>"
|
return "Search a movie title with: !imdbs <approximative title> ; View movie details with !imdb <title>"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Various network tools (w3m, w3c validator, curl, traceurl, ...)"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import http.client
|
import http.client
|
||||||
import json
|
import json
|
||||||
@ -21,10 +23,6 @@ def load(context):
|
|||||||
else:
|
else:
|
||||||
add_hook("cmd_hook", Hook(cmd_whois, "netwhois"))
|
add_hook("cmd_hook", Hook(cmd_whois, "netwhois"))
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "The networking module"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!traceurl /url/: Follow redirections from /url/."
|
return "!traceurl /url/: Follow redirections from /url/."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Informe les usagers des prochains passages des transports en communs de la RATP"""
|
||||||
|
|
||||||
import http.client
|
import http.client
|
||||||
import re
|
import re
|
||||||
from xml.dom.minidom import parseString
|
from xml.dom.minidom import parseString
|
||||||
@ -13,10 +15,6 @@ def load(context):
|
|||||||
DATAS.setIndex("name", "station")
|
DATAS.setIndex("name", "station")
|
||||||
|
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "Informe les usagers des prochains passages des transports en communs de la RATP"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "!ratp transport line [station]: Donne des informations sur les prochains passages du transport en commun séléctionné à l'arrêt désiré. Si aucune station n'est précisée, les liste toutes."
|
return "!ratp transport line [station]: Donne des informations sur les prochains passages du transport en commun séléctionné à l'arrêt désiré. Si aucune station n'est précisée, les liste toutes."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Get information about subreddit"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
@ -8,10 +10,6 @@ nemubotversion = 3.4
|
|||||||
|
|
||||||
from hooks import hook
|
from hooks import hook
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "The subreddit module"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!subreddit /subreddit/: Display information on the subreddit."
|
return "!subreddit /subreddit/: Display information on the subreddit."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Help to make choice"""
|
||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from hooks import hook
|
from hooks import hook
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Find information about an SAP transaction codes"""
|
||||||
|
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
@ -10,9 +12,6 @@ from tools.web import striphtml
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
return "Find information about an SAP transaction codes"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "!tcode <transaction code|keywords>"
|
return "!tcode <transaction code|keywords>"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""as http://sleepyti.me/, give you the best time to go to bed"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import imp
|
import imp
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -9,10 +11,6 @@ from hooks import hook
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "as http://sleepyti.me/, give you the best time to go to bed"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "If you would like to sleep soon, use !sleepytime to know the best time to wake up; use !sleepytime hh:mm if you want to wake up at hh:mm"
|
return "If you would like to sleep soon, use !sleepytime to know the best time to wake up; use !sleepytime hh:mm if you want to wake up at hh:mm"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Send SMS using SMS API (currently only Free Mobile)"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
@ -15,10 +17,6 @@ def load(context):
|
|||||||
global DATAS
|
global DATAS
|
||||||
DATAS.setIndex("name", "phone")
|
DATAS.setIndex("name", "phone")
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "Send SMS using SMS API (currently only Free Mobile)"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!sms /who/[,/who/[,...]] message: send a SMS to /who/."
|
return "!sms /who/[,/who/[,...]] message: send a SMS to /who/."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Check words spelling"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
|
|
||||||
@ -10,9 +12,6 @@ from .pyaspell import AspellError
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
return "Check words spelling"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!spell [<lang>] <word>: give the correct spelling of <word> in <lang=fr>."
|
return "!spell [<lang>] <word>: give the correct spelling of <word> in <lang=fr>."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Find french synonyms"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
@ -10,9 +12,6 @@ from tools import web
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
return "Find french synonyms"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!syno <word>: give a list of synonyms for <word>."
|
return "!syno <word>: give a list of synonyms for <word>."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Translation module"""
|
||||||
|
|
||||||
import http.client
|
import http.client
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
@ -30,10 +32,6 @@ def load(context):
|
|||||||
add_hook("cmd_hook", Hook(cmd_translate, "translate"))
|
add_hook("cmd_hook", Hook(cmd_translate, "translate"))
|
||||||
|
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "Translation module"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!translate [lang] <term>[ <term>[...]]: Found translation of <term> from/to english to/from <lang>. Data © WordReference.com"
|
return "!translate [lang] <term>[ <term>[...]]: Found translation of <term> from/to english to/from <lang>. Data © WordReference.com"
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Gets information about velib stations"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from tools import web
|
from tools import web
|
||||||
@ -15,10 +17,6 @@ def load(context):
|
|||||||
# station_status)
|
# station_status)
|
||||||
# context.add_event(evt)
|
# context.add_event(evt)
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "Gets information about velib stations"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "!velib /number/ ...: gives available bikes and slots at the station /number/."
|
return "!velib /number/ ...: gives available bikes and slots at the station /number/."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""Alert on changes on websites"""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import http.client
|
import http.client
|
||||||
@ -17,10 +19,6 @@ from .atom import Atom
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "Alert on changes on websites"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "This module is autonomous you can't interract with it."
|
return "This module is autonomous you can't interract with it."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""The weather module"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
@ -27,10 +29,6 @@ def load(context):
|
|||||||
add_hook("cmd_hook", Hook(cmd_coordinates, "coordinates"))
|
add_hook("cmd_hook", Hook(cmd_coordinates, "coordinates"))
|
||||||
|
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "The weather module"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "!weather /city/: Display the current weather in /city/."
|
return "!weather /city/: Display the current weather in /city/."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""The 2014 football worldcup module"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
@ -19,10 +21,6 @@ def load(context):
|
|||||||
add_event(ModuleEvent(func=lambda url: urlopen(url, timeout=10).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, intervalle=30))
|
add_event(ModuleEvent(func=lambda url: urlopen(url, timeout=10).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, intervalle=30))
|
||||||
|
|
||||||
|
|
||||||
def help_tiny ():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "The 2014 football worldcup module"
|
|
||||||
|
|
||||||
def help_full ():
|
def help_full ():
|
||||||
return "!worldcup: do something."
|
return "!worldcup: do something."
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
|
"""URL reducer module"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
@ -9,10 +11,6 @@ from hooks import hook
|
|||||||
|
|
||||||
nemubotversion = 3.4
|
nemubotversion = 3.4
|
||||||
|
|
||||||
def help_tiny():
|
|
||||||
"""Line inserted in the response to the command !help"""
|
|
||||||
return "Gets YCC urls"
|
|
||||||
|
|
||||||
def help_full():
|
def help_full():
|
||||||
return "!ycc [<url>]: with an argument, reduce the given <url> thanks to ycc.fr; without argument, reduce the last URL said on the current channel."
|
return "!ycc [<url>]: with an argument, reduce the given <url> thanks to ycc.fr; without argument, reduce the last URL said on the current channel."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user