Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi i need help please #192

Open
mrssine opened this issue Mar 15, 2023 · 10 comments
Open

Hi i need help please #192

mrssine opened this issue Mar 15, 2023 · 10 comments

Comments

@mrssine
Copy link

mrssine commented Mar 15, 2023

`/**********************************************************

  • @INFO [TABLE OF CONTENTS]
  • 1 Import_Modules
    • 1.1 Validating script for advertisement
  • 2 CREATE_THE_DISCORD_BOT_CLIENT
  • 3 Load_Discord_Buttons_and_Discord_Menus
  • 4 Create_the_client.memer
  • 5 create_the_languages_objects
  • 6 Raise_the_Max_Listeners
  • 7 Define_the_Client_Advertisments
  • 8 LOAD_the_BOT_Functions
  • 9 Login_to_the_Bot
  • BOT CODED BY: MrSSINE
    *********************************************************/

/**********************************************************

  • @param {1} Import_Modules for this FIle
    *********************************************************/
    const Discord = require("discord.js");
    const colors = require("colors");
    const enmap = require("enmap");
    const fs = require("fs");
    const OS = require('os');
    const Events = require("events");
    const emojis = require("./botconfig/emojis.json")
    const config = require("./botconfig/config.json")
    const advertisement = require("./botconfig/advertisement.json")
    const { delay } = require("./handlers/functions")
    require('dotenv').config()

/**********************************************************

  • @param {2} CREATE_THE_DISCORD_BOT_CLIENT with some default settings
    *********************************************************/
    const client = new Discord.Client({
    fetchAllMembers: false,
    restTimeOffset: 0,
    failIfNotExists: false,
    shards: "auto",
    allowedMentions: {
    parse: ["roles", "users"],
    repliedUser: false,
    },
    partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'GUILD_MEMBER', 'USER'],
    Intents: [
    Discord.Intents.FLAGS.GUILDS,
    Discord.Intents.FLAGS.GUILD_MEMBERS,
    Discord.Intents.FLAGS.GUILD_BANS,
    Discord.Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
    Discord.Intents.FLAGS.GUILD_INTEGRATIONS,
    Discord.Intents.FLAGS.GUILD_WEBHOOKS,
    Discord.Intents.FLAGS.GUILD_INVITES,
    Discord.Intents.FLAGS.GUILD_VOICE_STATES,
    Discord.Intents.FLAGS.GUILD_PRESENCES,
    Discord.Intents.FLAGS.GUILD_MESSAGES,
    Discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
    //Discord.Intents.FLAGS.GUILD_MESSAGE_TYPING,
    Discord.Intents.FLAGS.DIRECT_MESSAGES,
    Discord.Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
    //Discord.Intents.FLAGS.DIRECT_MESSAGE_TYPING
    ],
    presence: {
    activities: [{ name: ${config.status.text}.replace("{prefix}", config.prefix), type: config.status.type, url: config.status.url }],
    status: "online"
    }
    });

/**********************************************************

  • @param {4} Create_the_client.memer property from Tomato's Api
    *********************************************************/
    const Meme = require("memer-api");
    client.memer = new Meme(process.env.memer_api || config.memer_api); // GET a TOKEN HERE: https://discord.gg/Mc2FudJkgP

/**********************************************************

  • @param {5} create_the_languages_objects to select via CODE
    *********************************************************/
    client.la = {}
    var langs = fs.readdirSync("./languages")
    for (const lang of langs.filter(file => file.endsWith(".json"))) {
    client.la[${lang.split(".json").join("")}] = require(./languages/${lang})
    }
    Object.freeze(client.la)
    //function "handlemsg(txt, options? = {})" is in /handlers/functions

/**********************************************************

  • @param {6} Raise_the_Max_Listeners to 0 (default 10)
    *********************************************************/
    client.setMaxListeners(0);
    Events.defaultMaxListeners = 0;
    process.env.UV_THREADPOOL_SIZE = OS.cpus().length;

/**********************************************************

  • @param {7} Define_the_Client_Advertisments from the Config File
    *********************************************************/
    client.ad = {
    enabled: advertisement.adenabled,
    statusad: advertisement.statusad,
    spacedot: advertisement.spacedot,
    textad: advertisement.textad
    }

/**********************************************************

  • @param {8} LOAD_the_BOT_Functions
    *******************************************************/
    //those are must haves, they load the dbs, events and commands and important other stuff
    function requirehandlers() {
    ["extraevents", "clientvariables", "command", "loaddb", "events", "erelahandler", "slashCommands"].forEach(handler => {
    try { require(./handlers/${handler})(client); } catch (e) { console.log(e.stack ? String(e.stack).grey : String(e).grey) }
    });
    ["twitterfeed", /
    "twitterfeed2",
    / "livelog", "youtube", "tiktok"].forEach(handler => {
    try { require(./social_log/${handler})(client); } catch (e) { console.log(e.stack ? String(e.stack).grey : String(e).grey) }
    });
    ["logger", "anti_nuke", "antidiscord", "antilinks", "anticaps", "antispam", "blacklist", "keyword", "antimention", "autobackup",

    "apply", "ticket", "ticketevent",
    "roster", "joinvc", "epicgamesverification", "boostlog",

    "welcome", "leave", "ghost_ping_detector", "antiselfbot",

    "jointocreate", "reactionrole", "ranking", "timedmessages",

    "membercount", "autoembed", "suggest", "validcode", "dailyfact", "autonsfw",
    "aichat", "mute", "automeme", "counter"].forEach(handler => {
    try { require(./handlers/${handler})(client); } catch (e) { console.log(e.stack ? String(e.stack).grey : String(e).grey) }
    });
    } requirehandlers();

/**********************************************************

  • @param {9} Login_to_the_Bot
    *********************************************************/
    client.login(process.env.token || config.token);

/**********************************************************

  • @INFO
  • Bot Coded by Tomato#6966 | https://discord.gg/milrato
  • @INFO
  • Work for Milrato Development | https://milrato.eu
  • @INFO
  • Please mention him / Milrato Development, when using this Code!
  • @INFO
    *********************************************************/`

ERROR /

image

@ShadowGaming100
Copy link

Discord.js version?

@GhostWasFound13
Copy link

discord.js v14?

@NNKTV28
Copy link

NNKTV28 commented May 15, 2023

it needs to be discord.js V13 for it to properly work

@PHV08
Copy link

PHV08 commented Aug 15, 2023

use npm install discord.js@13

@ImSe4n
Copy link

ImSe4n commented Aug 17, 2023

Bot is outdated, wouldn't recommend using it. Find a newer/better one on github.

@PHV08
Copy link

PHV08 commented Aug 18, 2023

Bot is outdated, wouldn't recommend using it. Find a newer/better one on github.

Actually no its not outdated

@vuthanhtrung2010
Copy link

Bot is outdated, wouldn't recommend using it. Find a newer/better one on github.

Actually no its not outdated
as my reference in official Mivator server this will be stop maintaining.

@PHV08
Copy link

PHV08 commented Jul 31, 2024

I am Maintaining it

@NNKTV28
Copy link

NNKTV28 commented Aug 15, 2024

I am Maintaining it

the comunity needs more people like you

@vuthanhtrung2010
Copy link

I am Maintaining it

well, I write my own. In typescript, DJS v14, strict type checking... And nothing is deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants