def handle(self, player, action, values, **kwargs): # pragma: no cover
await self.close(player)
# Try to parse the button id instead of the whole action string.
button = action
try:
match = re.search('button_([0-9]+)$', action)
if len(match.groups()) == 1:
button = match.group(1)
except:
pass
if not self.response_future.done():
self.response_future.set_result(button)
if self.target:
await self.target(player, action, values, **kwargs)
评论列表
文章目录