Add event ID parameter to karma up/down commands
This commit is contained in:
parent
959dabeda0
commit
6ddd2333a0
1 changed files with 7 additions and 5 deletions
12
karma/bot.py
12
karma/bot.py
|
@ -69,13 +69,15 @@ class KarmaBot(Plugin):
|
||||||
async def karma(self) -> None:
|
async def karma(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@karma.subcommand("up", help="Upvote a message")
|
@karma.subcommand("up", help="Upvote an event")
|
||||||
def upvote(self, evt: MessageEvent) -> Awaitable[None]:
|
@command.argument("event_id", "Event ID", required=True)
|
||||||
return self._vote(evt, evt.content.get_reply_to(), +1)
|
def upvote(self, evt: MessageEvent, event_id: EventID) -> Awaitable[None]:
|
||||||
|
return self._vote(evt, event_id, +1)
|
||||||
|
|
||||||
@karma.subcommand("down", help="Downvote a message")
|
@karma.subcommand("down", help="Downvote a message")
|
||||||
def downvote(self, evt: MessageEvent) -> Awaitable[None]:
|
@command.argument("event_id", "Event ID", required=True)
|
||||||
return self._vote(evt, evt.content.get_reply_to(), -1)
|
def downvote(self, evt: MessageEvent, event_id: EventID) -> Awaitable[None]:
|
||||||
|
return self._vote(evt, event_id, -1)
|
||||||
|
|
||||||
@command.passive(UPVOTE)
|
@command.passive(UPVOTE)
|
||||||
def upvote(self, evt: MessageEvent, _: Tuple[str]) -> Awaitable[None]:
|
def upvote(self, evt: MessageEvent, _: Tuple[str]) -> Awaitable[None]:
|
||||||
|
|
Loading…
Reference in a new issue