@harukoto/discord.jsk-selfbot
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

discord.jsk, discord.js jishaku (jishaku for discord.js)

This project is to make jishaku from discord.py available for discord.js.

The original jishaku (discord.py) is here: https://github.com/Gorialis/jishaku The original discord.jsk is here: https://www.npmjs.com/package/@uplc/discord.jsk

Installation

  1. install using npm, pnpm, or yarn
# npm
npm install @uplc/discord.jsk

# pnpm
pnpm install @uplc/discord.jsk

# yarn
yarn add @uplc/discord.jsk
  1. add discord.jsk to discord.js

Here, a sample bot is created. Discord.jsk requires Message Content Intent, please enable Message Content Intent on Discord Developer Portal before using discord.jsk.

// https://discordjs.guide/creating-your-bot/main-file.html
// Require the necessary discord.js classes
const { Client, Events, GatewayIntentBits } = require("discord.js");
const { token } = require("./config.json");

// Require the necessary discord.jsk class
const djsk = require("@uplc/discord.jsk");

// Create a new client instance
// Important! Message Content Intent must be enabled to use djsk.
const client = new Client({
  intents: [
    GatewayIntentBits.MessageContent,
    /* Required for guild use */
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.GuildMessageReactions,
  ],
});

// discord.jsk object
let jsk = {};

// When the client is ready, run this code (only once).
// The distinction between `client: Client<boolean>` and `readyClient: Client<true>` is important for TypeScript developers.
// It makes some properties non-nullable.
client.once(Events.ClientReady, (readyClient) => {
  // init discord.jsk
  jsk = new djsk(client, {
    encoding: "UTF-8" /* Shift-JIS is recommended for Japanese environment */,
    useableUserId: ["0", "1"] /* Users who can use the bot */,
  });

  console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});

client.on(Events.MessageCreate, (message) => jsk.onMessageCreated(message));

client.login(token)

Usage

This section describes how to use each command.

.jsk sh <command>

This command is a command to use shell commands. This feature currently only works on **Windows. **

is the command to execute.

.jsk js <code>

This command executes JavaScript code.

Please fill in the <code> with the code you want to run.

Credits

Name Description
discord.js the base part of discord.jsk
jishaku source of this project
TypeScript Language used for discord.jsk

Package Sidebar

Install

npm i @harukoto/discord.jsk-selfbot

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

16 kB

Total Files

4

Last publish

Collaborators

  • harukoto