Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hangupsbot/commands/alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def gethoalias(bot, event, *args):
if len(args) > 1:
raise Help(_('Too many arguments!'))

elif args and event.user_id.chat_id not in bot.config['admins']:
if args and event.user_id.chat_id not in bot.config['admins']:
raise Help(_('You are not authorized to do that!'))

alias_list = bot.memory['hoalias']
Expand Down
30 changes: 15 additions & 15 deletions hangupsbot/commands/convid.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ async def convfilter(bot, event, *args):
if len(posix_args) > 1:
raise Help(_("<em>1 parameter required, {} supplied - enclose parameter"
" in double-quotes</em>").format(len(posix_args)))
elif not posix_args:
if not posix_args:
raise Help(_("<em>supply 1 parameter</em>"))
else:
lines = []
for convid, convdata in bot.conversations.get(
filter=posix_args[0]).items():
lines.append(
"`{}` <b>{}</b> ({})".format(
convid, convdata["title"], len(convdata["participants"]))
)
lines.append(_('<b>Total: {}</b>').format(len(lines)))
message = '\n'.join(lines)

await bot.coro_send_message(event.conv_id, message)

return {"api.response": message}

lines = []
for convid, convdata in bot.conversations.get(
filter=posix_args[0]).items():
lines.append(
"`{}` <b>{}</b> ({})".format(
convid, convdata["title"], len(convdata["participants"]))
)
lines.append(_('<b>Total: {}</b>').format(len(lines)))
message = '\n'.join(lines)

await bot.coro_send_message(event.conv_id, message)

return {"api.response": message}


async def convecho(bot, dummy, *args):
Expand Down
3 changes: 3 additions & 0 deletions hangupsbot/plugins/convtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ async def kick(bot, event, *args):
bot (hangupsbot.core.HangupsBot): the running instance
event (hangupsbot.event.ConversationEvent): a message container
args (str):additional words passed to the command

Raises:
commands.Help: the user to kick is missing
"""
parameters = list(args)

Expand Down
6 changes: 6 additions & 0 deletions hangupsbot/plugins/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ def global_subscribe(bot, event, *args):

Returns:
str: a status message

Raises:
commands.Help: the keyword to subscribe is missing
"""
if not args:
raise commands.Help('Missing keyword and/or conversation!')
Expand Down Expand Up @@ -485,6 +488,9 @@ def global_unsubscribe(bot, event, *args):

Returns:
str: a status message

Raises:
commands.Help: the keyword to unsubscribe is missing
"""
if not args:
raise commands.Help('Missing keyword and/or conversation!')
Expand Down
4 changes: 2 additions & 2 deletions hangupsbot/plugins/tldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def tldr_base(bot, conv_id, parameters):

return message, display

elif parameters[0] == "edit":
if parameters[0] == "edit":
if len(parameters) > 2 and parameters[1].isdigit():
sorted_keys = sorted(list(conv_tldr.keys()), key=float)
key_index = int(parameters[1]) - 1
Expand All @@ -306,7 +306,7 @@ def tldr_base(bot, conv_id, parameters):

return message, display

elif parameters[0]: # need a better looking solution here
if parameters[0]: # need a better looking solution here
text = ' '.join(parameters)
if text:
# Add message to list
Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
aiohttp==3.5.4
aioresponses==0.6.0
appdirs==1.4.3
astroid==2.1.0
astroid==2.2.5
async-timeout==3.0.1
atomicwrites==1.3.0
attrs==18.2.0
Expand Down Expand Up @@ -51,7 +51,7 @@ pushbullet.py==0.11.0
py==1.8.0
pyasn1-modules==0.2.4
pyasn1==0.4.5
pylint==2.2.2
pylint==2.3.1
pyslack==0.4.0
pytest-asyncio==0.10.0
pytest==4.3.0
Expand Down