Skip to content

Commit

Permalink
add describe shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Tanay committed Feb 29, 2016
1 parent 98a60e5 commit dc76820
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def activate(self):

@botcmd(split_args_with=None)
def wiki_describe(self, mess, args):
"""Fetch the upcoming events for a from meetup.com."""
"""Fetch the upcoming events for a from wikipedia.org."""
if len(args) == 0:
return 'What do you want me to describe ?'
try:
Expand All @@ -53,6 +53,11 @@ def wiki_describe(self, mess, args):
return "No wikipedia entry found."
return '{0} ({1})'.format(self.format_summary(res.summary), res.url)

@botcmd(split_args_with=None)
def describe(self, mess, args):
"""Shortcut for wiki_describe"""
return self.wiki_describe(mess, args)

def format_summary(self, summary):
return (summary[:self.config['SUMMARY_MAX_LENGTH']]+'...'
if len(summary) > self.config['SUMMARY_MAX_LENGTH']
Expand Down

0 comments on commit dc76820

Please sign in to comment.