Broadcast.js 613 B

12345678910111213141516171819202122232425
  1. const log$q = new Logger("xverse-broadcast")
  2. class Broadcast{
  3. constructor(e, t) {
  4. this.room = e,
  5. Ee.handlers.push(t)
  6. }
  7. async handleBroadcast(e) {
  8. let t = null;
  9. try {
  10. t = JSON.parse(e.broadcastAction.data)
  11. } catch (r) {
  12. log$q.error(r);
  13. return
  14. }
  15. }
  16. broadcast(e) {
  17. const {data: t, msgType: r=MessageHandleType.MHT_FollowListMulticast, targetUserIds: n} = e;
  18. return this.room.actionsHandler.broadcast({
  19. data: t,
  20. msgType: r,
  21. targetUserIds: n
  22. })
  23. }
  24. }
  25. ;