Struct TransportFrame
- Namespace
- DSharpPlus.Net.Gateway
- Assembly
- DSharpPlus.dll
Represents an union between a string message read from the gateway, an exception or a close code.
public readonly record struct TransportFrame
Constructors
- TransportFrame(object)
Creates a new transport frame from the specified data.
Properties
- IsSuccess
Indicates whether reading this gateway frame was successful.
Methods
- TryGetErrorCode(out int)
Attempts to retrieve the error code returned attempting to read this frame.
- TryGetException(out Exception?)
Attempts to retrieve the exception thrown attempting to read this frame.
- TryGetException<T>(out T?)
Attempts to retrieve the exception thrown attempting to read this frame.
- TryGetMessage(out string?)
Attempts to retrieve the string message received.
- TryGetStreamMessage(out MemoryStream?)
Attempts to retrieve a message wrapped in a MemoryStream. This is only permissible if the log level is higher than Trace or if inbound gateway logging is disabled.