Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discorator.js

The Discord API Wrapper that works for both bots and user accounts.

Warning

not being updated anymore but feel free to fork it or whatever

Installing

npm

npm i discorator.js

Example

You can check the example files in the testing directory for more details, but you log into Discord like this:

import { Client, IntentBits, TextChannel, generateNonce } from 'discorator.js'

(async function() {
    const client = await new Client({ 
        verbose: true, 
        userType: 'user',
        intents: [IntentBits.Guilds, IntentBits.Direct_Messages, IntentBits.Message_Content, IntentBits.Guild_Messages]
    });
    await client.loginByToken('token') // token login
    // await client.loginByCredentials({email: 'h@h.com', password: 'h', captchaToken: '2captcha-token'}) // credential login (todo: totp support)

    // send command to a channel
    let channel = await new TextChannel(client).fetch('channel_id') // create a new channel and initialize it
    let res = await channel.emitCommand('ping', 'id') // issue a command (name and application id), subcommand and args are under the 'options' argument, although they need to be manually constructed at the moment.
    
})();
``

About

A Discord API Wrapper that works for both user and bot. Currently not all classes are implemented.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages