fix undefined variable

This commit is contained in:
udf 2018-11-28 16:19:14 +02:00
parent f751ed707d
commit 7a90830621
Signed by: kate
GPG Key ID: E40724BAD73AF77B
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ Contains code used by other kbass_* plugins
from uniborg import util from uniborg import util
async def get_target_message(event): async def get_target_message(borg, event):
""" """
If the event is a reply, returns the reply message if it's from us If the event is a reply, returns the reply message if it's from us
If event is not a reply, then it tries to return the most recent message If event is not a reply, then it tries to return the most recent message
@ -22,7 +22,7 @@ def self_reply_cmd(borg, pattern):
@borg.on(util.admin_cmd(pattern)) @borg.on(util.admin_cmd(pattern))
async def wrapped(event, *args, **kwargs): async def wrapped(event, *args, **kwargs):
await event.delete() await event.delete()
target = await get_target_message(event) target = await get_target_message(borg, event)
if not target: if not target:
return return
return await function(event, target, *args, **kwargs) return await function(event, target, *args, **kwargs)