MCPcopy Index your code
hub / github.com/OceanicJS/Oceanic

github.com/OceanicJS/Oceanic @v1.14.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.14.0 ↗ · + Follow
2,435 symbols 4,138 edges 144 files 754 documented · 31%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

const { Client } = require("oceanic.js");
const client = new Client({ auth: "Bot [TOKEN]" });

client.on("ready", async() => {
    console.log("Ready as", client.user.tag);
});

// if you do not add a listener for the error event, any errors will cause an UncaughtError to be thrown,
// and your process may be killed as a result.
client.on("error", (err) => {
    console.error("Something Broke!", err);
});

client.connect();

For more examples, see the examples folder on GitHub.


Installation

NodeJS 18.13.0 or higher is required.

See Development Builds if you wish to install in-dev versions.

npm i oceanic.js --omit=optional

If you need voice support, add --include=optional. Voice support is provided by @discordjs/voice. Requires NodeJS 22.12.0 or higher.

See the examples folder on GitHub for some examples, and visit this site for documentation.

Development Builds

npm i oceanic.js@dev

The documentation under dev is always for the latest commit. If something isn't working that's in the documentation, you're likely looking at the wrong documentation.


Optional Dependencies

All compression options are mutually exclusive. * pako - zlib Compression (gateway) * zlib-sync - zlib Compression (gateway, faster than pako) * erlpack - Encoding (gateway, alternative to JSON) * zstd-napi - zstd compression (gateway) * node:zlib (node >=22.15.0, >=23.8.0) - zstd compression (gateway, faster than zstd-napi) * @discordjs/voice - voice, requires node >=22.12.0

Links

Extension points exported contracts — how you extend this code

GetChannelMessagesOptions (Interface)
(no doc) [2 implementers]
lib/types/channels.d.ts
ChannelTypeMap (Interface)
(no doc)
lib/Constants.ts
InviteWithoutCounts (Interface)
(no doc)
lib/structures/Invite.ts
ExtraOptions (Interface)
(no doc)
lib/util/TypedCollection.ts
PakoExtra (Interface)
(no doc)
lib/gateway/compression/pako.ts
GetChannelMessagesIteratorOptions (Interface)
(no doc) [2 implementers]
lib/types/channels.d.ts
RawChannelTypeMap (Interface)
(no doc)
lib/Constants.ts
InviteWithScheduledEvent (Interface)
(no doc)
lib/structures/Invite.ts

Core symbols most depended-on inside this repo

get
called by 214
lib/routes/Users.ts
map
called by 199
lib/util/Collection.ts
authRequest
called by 157
lib/rest/RESTManager.ts
emit
called by 146
lib/util/TypedEmitter.ts
encode
called by 123
lib/util/Routes.ts
update
called by 100
lib/structures/User.ts
_freeze
called by 87
lib/util/Util.ts
setIfPresent
called by 65
lib/util/QueryBuilder.ts

Shape

Method 1,140
Interface 766
Class 217
Function 210
Enum 102

Languages

TypeScript100%

Modules by API surface

lib/types/channels.d.ts199 symbols
lib/util/Routes.ts125 symbols
lib/structures/Guild.ts110 symbols
lib/Constants.ts106 symbols
lib/types/guilds.d.ts104 symbols
lib/routes/Guilds.ts92 symbols
lib/types/interactions.d.ts82 symbols
lib/types/gateway-raw.d.ts80 symbols
lib/types/applications.d.ts78 symbols
lib/gateway/events.ts73 symbols
lib/types/json.d.ts66 symbols
lib/routes/Channels.ts62 symbols

For agents

$ claude mcp add Oceanic \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact