discord.js-selfbot-rpc

1.0.1 • Public • Published

discord.js-selfbot-rpc

A simple package to create a Discord Rich Presence for selfbot using discord.js-selfbot-v13 library

npm:discord.js-selfbot-rpc

Installation

npm install discord.js-selfbot-rpc

Example (Rich Presence)

Simple:

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();

const { RichPresence } = require('discord.js-selfbot-rpc');

client.on('ready', () => {
    const presence = new RichPresence()
        .setStatus('dnd') // Must be one of (online, idle, dnd) default is online
        .setName('Discord')
        .setTimestamp();

    client.user.setPresence(presence.toData());
    console.log('Rich Presence has running...');

    console.log(`Login as ${client.user.tag}`);
});

client.login('token');

example-rpc:simple

With customization + image:

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();

const { RichPresence, Util } = require('discord.js-selfbot-rpc');

client.on('ready', async() => { // Using async-await to perform util get application assets
    const applicationId = '984373297644961894'; // Your Application ID

    // This is example for get image assets data from application
    const chromeImage = await Util.getAssets(applicationId, 'chrome'); // Get image assets by name (chrome) from application assets
    const googleImage = await Util.getAssets(applicationId, 'google'); // Get image assets by name (google) from application assets

    const presence = new RichPresence()
        .setStatus('dnd') // Must be one of (online, idle, dnd) default is online
        .setType('PLAYING') // Must be one of (PLAYING, STREAMING, LISTENING, WATCHING) default is PLAYING
        .setApplicationId(applicationId)
        .setName('Chrome')
        .setDetails('View Homepage')
        .setState('Searching anime...')
        .setAssetsLargeImage(chromeImage.id)
        .setAssetsLargeText('Chrome')
        .setAssetsSmallImage(googleImage.id)
        .setAssetsSmallText('Google')
        .setTimestamp();

    client.user.setPresence(presence.toData());
    console.log('Rich Presence has running...');

    console.log(`Login as ${client.user.tag}`);
});

client.login('token');

example-rpc:chrome

Example (Custom Status)

Simple:

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();

const { CustomStatus } = require('discord.js-selfbot-rpc');

client.on('ready', () => {
    const customStatus = new CustomStatus()
        .setStatus('dnd') // Must be one of (online, idle, dnd) default is online
        .setState('Powered by discord.js-selfbot-rpc');

    client.user.setPresence(customStatus.toData());
    console.log('Custom Status has running...');

    console.log(`Login as ${client.user.tag}`);
});

client.login('token');

example-cs:simple

With custom emoji:

Important! Using discord custom emoji only applies to nitro users!

const { Client } = require('discord.js-selfbot-v13');
const client = new Client();

const { CustomStatus } = require('discord.js-selfbot-rpc');

client.on('ready', () => {
    const customStatus = new CustomStatus()
        .setStatus('dnd') // Must be one of (online, idle, dnd) default is online
        .setState('Powered by discord.js-selfbot-rpc')
        .setEmoji('🔥');

    client.user.setPresence(customStatus.toData());
    console.log('Custom Status has running...');

    console.log(`Login as ${client.user.tag}`);
});

client.login('token');

example-cs:with_emoji

Example (Util)

Here are some examples of using Util from this package that you can use

const { Util } = require('discord.js-selfbot-rpc');
const applicationId = '984373297644961894'; // Your Application ID 

// Fetch available assets data from application
Util.fetchAssets(applicationId).then(result => {
    console.log(result); // JSON { data: Array, statusCode: Number }
})
.catch(console.error);

// Find image assets by name from application
Util.getAssets(applicationId, 'assets text name').then(result => 
    console.log(result); // return raw object, but undefined is result not available
})
.catch(console.error);

Package Sidebar

Install

npm i discord.js-selfbot-rpc

Weekly Downloads

42

Version

1.0.1

License

Apache-2.0

Unpacked Size

265 kB

Total Files

13

Last publish

Collaborators

  • devinofc