Giter Site home page Giter Site logo

kajukatliii / music-selfbot-discord Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 25.0 70 KB

This is a self bot which plays music in voice channel.

License: MIT License

JavaScript 98.14% Dockerfile 1.54% Nix 0.32%
discord discord-bot discord-js discord-js-bot discord-music-bot discord-music-bot-24-7 discord-token discordapp discordbot discordjs

music-selfbot-discord's Introduction

KAJUKATLii MUSIC SELFBOT v4

This uses uses users token to play music in voice channel.

Languages Used

javascript javascript javascript

Deployment

To deploy this project on Replit.

Run on Repl.it

To Host Bot 24/7

Use UPTIMEROBOT to run bot 24/7

CODE EXAMPLE

const Discord = require("discord.js-selfbot");
const client = new Discord.Client();
const fs = require('fs');
const Enmap = require('enmap');
const utils = require('./utils');
const keepAlive = require("./server")

if (!process.env.TOKEN){
  try{
    const config = require("./config");
    global.config = {'token': config.token, 'prefix': config.prefix};
  } catch (e){
    console.error("No config file found, create it or use environnement variables.");
    process.exit(1);
  };
} else{
  if (!process.env.PREFIX) process.env.PREFIX="--";
  global.config = {'token': process.env.TOKEN, 'prefix': process.env.PREFIX};
}
if (!process.env.ALLOWED){
  try {global.config.allowed=require("./allowed.json").allowed}
  catch (e){
    global.config.allowed=[]
  }
} else{
  global.config.allowed=process.env.ALLOWED
}
keepAlive();
client.login(config.token)

utils.log("Logging in...");

/* ----------------------------------------------- */

global.queue = new Map();
client.commands = new Enmap();

/* ----------------------------------------------- */

var loaded = {events: [], commands: []};

var promise = new Promise((resolve) => {
  fs.readdir('./events/', (err, files) => {
    if (err) return console.error;
    files.forEach(file => {
      if (!file.endsWith('.js')) return;
      const evt = require(`./events/${file}`);
      let evtName = file.split('.')[0];
      loaded.events.push(evtName)
      client.on(evtName, evt.bind(null, client));
    });
    resolve();
  });
});


fs.readdir('./commands/', async (err, files) => {
  if (err) return console.error;
  files.forEach(file => {
    if (!file.endsWith('.js')) return;
    let props = require(`./commands/${file}`);
    props.names.list.forEach(name => {
      client.commands.set(name, props);
    })
    let cmdName = file.split('.')[0];
    loaded.commands.push(cmdName)
  });
  promise.then(() => {utils.log(`Table of commands and events :\n${utils.showTable(loaded)}`)});
});


/* --------------------------------------------------- */

To Run The Code

To run code, run the following command

  node index.js

Environment Variables

System environment variables.

To run this project, you will need to add the following environment variables to your .env file

For REPLIT

To run this project in replit , you will need to add the following environment variables to your secrets.

TOKEN DISCORD USERS TOKEN.

ALLOWED DISCORD USERS ID.

PREFIX Prefix which you want for your bot for example "!".

THE CODE MADE BY

WARNINGS

⚠️Warning : Self-bots are discouraged by Discord and is against Discord's ToS. You might get banned for this if not used properly.

⚠️Discord's Terms of Service : https://discord.com/terms

music-selfbot-discord's People

Contributors

kajukatliii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

music-selfbot-discord's Issues

Config file

there is no config.json file.. please add it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.