Oceanic Wrapper
Table of Contentsโ
Class Definitionโ
export class OceanicManager extends Manager {}
Constructorโ
new OceanicManager(client: Client, options?: ManagerOptions)
Parameter Type Description Optional clientClient The Oceanic client instance. optionsManagerOptionsThe manager options.
note
The constructor automatically hooks into the Oceanic client to:
- Set
clientIdfromclient.user.idonce thereadyevent fires. - Forward gateway packets to
updateVoiceState()via thepacketevent. - Throw a
MagmaStreamErrorifGUILD_VOICE_STATESis not present inclient.shards.options.intents(supports both numeric bitfield and string array formats).
Methodsโ
resolveGuild()โ
override resolveGuild(guildId: string): Guild | nullResolves a guild from the Oceanic guild cache by ID.
Parametersโ
Parameter Type Description Optional guildIdstring The guild ID to resolve. Returnsโ
Type Description Guild | null The cached guild, or nullif not found.
resolveUser()โ
override async resolveUser(user: AnyUser | string): Promise<User | AnyUser>Resolves a user from the Oceanic user cache by ID. Falls back to a minimal
{ id, username }object if not cached.Parametersโ
Parameter Type Description Optional userAnyUser| stringThe user object or user ID to resolve. Returnsโ
Type Description Promise<User | AnyUser>The resolved user, or a minimal fallback object.
send()โ
note
This method is protected. It is called internally and is not intended for direct use.
protected override send(packet: GatewayVoiceStateUpdate): voidSends a voice state update to Discord via the guild's shard using
shard.send.Parametersโ
Parameter Type Description Optional packetGatewayVoiceStateUpdate The voice state update packet to send.