Skip to content

DiscordUDP

DiscordUDP is an internal class responsible for managing UDP communication with the Discord API. This class handles sending and receiving UDP packets.

Properties

udpActive

DiscordUDP.udpActive  :: boolean

publicUdp

DiscordUDP.publicUdp  :: Nstring

onMessageRecv

DiscordUDP.onMessageRecv  :: Vendor.Signal<string>

onSocketDead

DiscordUDP.onSocketDead  :: Vendor.Signal<number>

socketInstance

DiscordUDP.socketInstance  :: WebSocket

reporter

DiscordUDP.reporter  :: Vendor.Console

socketUrl

DiscordUDP.socketUrl  :: string

socketActive

DiscordUDP.socketActive  :: string

socketActiveChanged

DiscordUDP.socketActiveChanged  :: Vendor.Signal<boolean>

socketThread

DiscordUDP.socketThread  :: thread?

Methods

sendAsync

DiscordUDP : sendAsync (

     dataPacket: string
)  -> Vendor.Future

Sends a UDP packet asynchronously.

connectAsync

DiscordUDP : connectAsync (

     discordUdp: string
)  -> Vendor.Future

Connects to a UDP socket asynchronously.

disconnectAsync

DiscordUDP : disconnectAsync (

     closingCode: string
)  -> Vendor.Future

Disconnects from the UDP socket asynchronously.

Functions

new

DiscordUDP . new (

     publicUdp: string
)  -> ()

Creates a new instance of DiscordUDP.