1.0.1 • Published 7 months ago

midjourney-discord-js v1.0.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
7 months ago

Midjourney Discord.js

Midjourney Discord.js

Midjourney Discord.js: An unofficial Node.js framework for interacting with the Midjourney API via Discord.

npm version npm downloads license

Features

  • Full Midjourney command support
  • Event-based architecture
  • Robust error handling
  • Rate limiting and queue management
  • Comprehensive TypeScript support
  • Detailed documentation

Installation

npm install midjourney-discord-js

Usage

const { MidjourneyClient } = require('midjourney-discord-js');

const client = new MidjourneyClient({
    token: 'YOUR_DISCORD_TOKEN',
});

async function generateImage() {
    await client.connect();
    const result = await client.imagine('a beautiful sunset');
    console.log('Grid generated:', result.url);
}
generateImage();

Requirements

  • Node.js >= 16.6.0
  • A Discord account with access to the Midjourney bot.
  • A valid Midjourney subscription.

Important Setup

Midjourney Subscription

To use this library, you must have an active Midjourney subscription. Visit the official Midjourney Pricing page to get started.

Obtaining Your Discord Token

To interact with Midjourney via Discord, you need your Discord user token. Follow these steps:

  1. Open Discord in your browser at https://discord.com and log in.
  2. Press F12 (Windows/Linux) or Cmd+Option+I (Mac) to open Developer Tools.
  3. Go to the Console tab and run the following script:
window.webpackChunkdiscord_app.push([
  [Math.random()],
  {},
  req => {
    if (!req.c) return;
    for (const m of Object.keys(req.c)
      .map(x => req.c[x].exports)
      .filter(x => x)) {
      if (m.default && m.default.getToken !== undefined) {
        return copy(m.default.getToken());
      }
      if (m.getToken !== undefined) {
        return copy(m.getToken());
      }
    }
  },
]);
console.log('%cWorked!', 'font-size: 50px');
console.log(`%cYou now have your token in the clipboard!`, 'font-size: 16px');
  1. The token will be copied to your clipboard. Keep it secure and private!

Disclaimer

Important Notice: This project makes use of discord.js-selfbot-v13, which allows interaction with the Discord API using user accounts. Using this library violates Discord's Terms of Service (ToS) and may result in the suspension or banning of your account.

Recommendations:

  • Create a separate Discord account solely for the purpose of using this tool.
  • Use this software at your own risk. VisualPay LLC does not endorse or encourage the violation of Discord's ToS.

By using this software:

  • You acknowledge the risks and take full responsibility for any consequences, including account bans, data loss, or other issues.
  • VisualPay LLC disclaims all liability arising from the misuse of this software.

Examples

You can find various usage examples in the examples directory. These examples include:

  • Basic Image Generation: How to generate a single image.
  • Batch Processing: Processing multiple prompts efficiently.
  • Event Handling: Listening to events such as imageGenerated or handling errors gracefully.

Explore the examples folder for more details.


Contributing

Contributions are welcome! Please adhere to the following guidelines:

  • Fork the repository and create a new branch for your feature or fix.
  • Submit a pull request with a clear description of your changes.
  • Ensure all tests pass and adhere to the code style.

Pull Request Process:

  1. Update documentation (if necessary).
  2. Add/update tests.
  3. Ensure all tests pass.
  4. Update CHANGELOG.md with a summary of changes.
  5. Submit your pull request.

Commit Message Guidelines:

  • feat: Add a new feature.
  • fix: Fix a bug.
  • docs: Update documentation.
  • test: Add or update tests.
  • refactor: Code refactoring without functional changes.

License

GNU General Public License v3.0

Copyright (C) 2024 VisualPay LLC

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Disclaimer: This project depends on the library discord.js-selfbot-v13, which violates the Discord Terms of Service (ToS). By using this software, you acknowledge the following:

  • The use of selfbot functionality is prohibited by Discord's ToS.
  • Using this software may result in the suspension or termination of your Discord account.
  • VisualPay LLC does not endorse or take responsibility for violations of Discord's ToS.
  • It is strongly recommended to create a separate Discord account and purchase a Midjourney subscription for this purpose.

Any use of this software is at the sole discretion and responsibility of the user.

Redistribution of this software must include this license and disclaimer.

For more information, see the GNU General Public License.


Support

If you encounter any issues or have questions, please open an issue in the GitHub repository.