turt2live / matrix-bot-sdk

TypeScript/JavaScript SDK for Matrix bots
MIT License
199 stars 69 forks source link

Implemented & documented edit functions #294

Open Denperidge opened 1 year ago

Denperidge commented 1 year ago

My apologies, I haven't been able to write the tests as of yet (due to inexperience with direct matrix API calls & jest, so any help with the tests would be appreciated). But I thought that either way I'd already send the edit functions themselves!

This would fix #198 !

Example usage

let eventId; 
eventId = await client.sendText(roomId, 'teext')
await client.editText(roomId, eventId, 'text');

eventId = await client.sendNotice(roomId, 'nootice')
await client.editNotice(roomId, eventId, 'notice');

eventId = await client.sendHtmlNotice(roomId, '<h2>htmlnootice</h2>')
await client.editHtmlNotice(roomId, eventId, '<h2>htmlnotice</h2>');

eventId = await client.sendHtmlText(roomId, '<h2>htmlteext</h2>')
await client.editHtmlText(roomId, eventId, '<h2>htmltext</h2>')

Checklist