文档

支持

Vivox Unity SDK

Vivox Unity SDK

编辑和删除消息

Edit and delete messages in channels.
阅读时间1 分钟最后更新于 13 天前

Vivox 提供了编辑和删除已发送到频道的消息的方法。

编辑频道消息

Vivox 允许用户使用
VivoxService.Instance.EditChannelTextMessageAsync(string channelName, string messageId, string newMessage)
编辑他们发送到频道的消息文本,其中 channelName 是消息发送到的频道的名称,messageId 是要更改的消息的 ID,newMessage 是更新的消息文本。
当频道中的任何人成功编辑消息后,频道中的所有人都将收到一个
VivoxService.Instance.ChannelMessageEdited
操作,其中包含已编辑的 VivoxMessage 以及更新的 MessageText。
public async void UpdateChannelMessageAsync(VivoxMessage messageToUpdate, string updatedMessageText){ await VivoxService.Instance.EditChannelTextMessageAsync(messageToUpdate.ChannelName, messageToUpdate.MessageId, updatedMessageText);}

删除频道消息

Vivox 允许用户使用
VivoxService.Instance.DeleteChannelTextMessageAsync(string channelName, string messageId)
删除他们发送到频道的消息,其中 channelName 是消息发送到的频道的名称,messageId 是要删除的消息的 ID。
当频道中的任何人成功删除消息后,频道中的所有人都将收到一个
VivoxService.Instance.ChannelMessageDeleted
操作,其中包含已删除的 VivoxMessage。
public async void DeleteChannelMessageAsync(VivoxMessage messageToDelete){ await VivoxService.Instance.DeleteChannelTextMessageAsync(messageToDelete.ChannelName, messageToDelete.MessageId)}