Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
confirm a definition removal
Browse files Browse the repository at this point in the history
  • Loading branch information
smn committed Feb 16, 2016
1 parent 76d8ab0 commit 217391f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions heatherr/definitions/bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def get_definition(bot_user_id, bot_user_name, message, match):
as_user=True,
text='Definitions for *%s*' % data['acronym'],
attachments=json.dumps([{
'pretext': ('Type `<@%s> remove <number> for %s` '
'to remove defintions') % (
'pretext': ('Type `<@%s>: remove <number> for %s` '
'to remove definitions') % (
bot_user_id, data['acronym'],),
'text': '\n'.join([
'%s (%s)' % (acronym.definition, acronym.pk)
Expand All @@ -60,5 +60,10 @@ def remove_definition(bot_user_id, bot_user_name, message, match):
pk=data['pk'],
acronym=data['acronym']).delete()
if deleted_rows:
slackaccount.api_call(
'reactions.add',
name='thumbsup',
channel=message['channel'],
timestamp=str(message['ts']),)
return message.reply('Deleted %(pk)s for %(acronym)s.' % data)
return message.reply('Sorry, don\'t know what to delete.')

0 comments on commit 217391f

Please sign in to comment.