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:
|
||||
pass
|
||||
|
||||
@karma.subcommand("up", help="Upvote a message")
|
||||
def upvote(self, evt: MessageEvent) -> Awaitable[None]:
|
||||
return self._vote(evt, evt.content.get_reply_to(), +1)
|
||||
@karma.subcommand("up", help="Upvote an event")
|
||||
@command.argument("event_id", "Event ID", required=True)
|
||||
def upvote(self, evt: MessageEvent, event_id: EventID) -> Awaitable[None]:
|
||||
return self._vote(evt, event_id, +1)
|
||||
|
||||
@karma.subcommand("down", help="Downvote a message")
|
||||
def downvote(self, evt: MessageEvent) -> Awaitable[None]:
|
||||
return self._vote(evt, evt.content.get_reply_to(), -1)
|
||||
@command.argument("event_id", "Event ID", required=True)
|
||||
def downvote(self, evt: MessageEvent, event_id: EventID) -> Awaitable[None]:
|
||||
return self._vote(evt, event_id, -1)
|
||||
|
||||
@command.passive(UPVOTE)
|
||||
def upvote(self, evt: MessageEvent, _: Tuple[str]) -> Awaitable[None]:
|
||||
|
|
Loading…
Reference in a new issue