Closed dsernst closed 2 years ago
Check out https://github.com/mobilecoinofficial/forest/blob/imogen-postgres/imogen/imogen.py#L248
To use this, you need to return None and send the message yourself, like
await self.send_message(None, "\N{Object Replacement Character} test", group=msg.group, mention=f"0:1:{msg.source}")
That mention argument is index of the replacement start:replacement length:identifier
. You don't actually need to use , a space works, but that's what the official clients do. The client fills in "@name" with whatever that person has saved as that contact's name.
We might consider an actual Response class like aiohttp so you could return an object with a mention attribute instead of this setup.
Ok, makes sense.
Thank you! 🙏
I'm trying to figure out how tag the user who sent a message.
Like at the bottom of this example from Imogen:
I looked through https://github.com/mobilecoinofficial/forest/blob/main/imogen/imogen.py but not seeing anywhere in there that's doing it. It looks like Imogen's "your Imoge is done" logic is being handled in the redis callback somewhere, but didn't see where exactly.
I see Forest's
Message.name
andMessage.source
, and they're both giving me the correct string data, but just sticking@
in front of them didn't turn either into a user tag. E.g.