mirror of
https://github.com/xaionaro-go/streamctl.git
synced 2025-11-03 01:53:24 +08:00
Start implementing "Send chat message"
This commit is contained in:
@@ -2783,3 +2783,29 @@ func (c *Client) BanUser(
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Client) SendChatMessage(
|
||||
ctx context.Context,
|
||||
platID streamcontrol.PlatformName,
|
||||
message string,
|
||||
) error {
|
||||
_, err := withStreamDClient(ctx, c, func(
|
||||
ctx context.Context,
|
||||
client streamd_grpc.StreamDClient,
|
||||
conn io.Closer,
|
||||
) (*streamd_grpc.SendChatMessageReply, error) {
|
||||
return callWrapper(
|
||||
ctx,
|
||||
c,
|
||||
client.SendChatMessage,
|
||||
&streamd_grpc.SendChatMessageRequest{
|
||||
PlatID: string(platID),
|
||||
Message: message,
|
||||
},
|
||||
)
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to submit the event: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user