Skip to content
Snippets Groups Projects
Commit 56344ac1 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Add disown command

parent caf1a03a
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ maubot: 0.1.0
id: ch.ethz.phys.rt
# A PEP 440 compliant version string.
version: 0.3.2
version: 0.3.3
# The SPDX license identifier for the plugin. https://spdx.org/licenses/
# Optional, assumes all rights reserved if omitted.
......
......@@ -363,6 +363,21 @@ class RT(Plugin):
f'took {self.html_link(number)} 👍️')
await evt.respond(content)
@rt.subcommand('disown', aliases=('di', 'dis'), help='Disown a ticket.')
@command.argument('number', 'ticket number', parser=str)
async def take(self, evt: MessageEvent, number: str) -> None:
if not self.can_manage(evt) or not self.valid_number(number):
return
await evt.mark_read()
displayname = await self._displayname(evt.room_id, evt.sender)
await self._edit(number, {'Owner': 'Nobody'})
content = TextMessageEventContent(
msgtype=MessageType.NOTICE, format=Format.HTML,
body=f'{displayname} disowned rt#{number} 👎️',
formatted_body=f'<a href="https://matrix.to/#/{evt.sender}">{evt.sender}</a> '
f'disowned {self.html_link(number)} 👎️')
await evt.respond(content)
@rt.subcommand('give', aliases=('g', 'gi', 'assign'), help='Give the ticket to somebody.')
@command.argument('number', 'ticket number', parser=str)
@command.argument('user', 'matrix user', parser=str)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment