-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
753 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,75 @@ | ||
const builder = require("./src/index") | ||
const path = require("path") | ||
const { owners, someServers, language } = require("./src/config.json") | ||
const WOKCommands = require("wokcommands") | ||
const mongoose = require("mongoose") | ||
const { Intents, Client } = require("discord.js") | ||
require("dotenv").config() | ||
const client = new Client({ | ||
intents: new Intents(["GUILDS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS"]), | ||
}) | ||
|
||
Falbot = new builder.Falbot() | ||
client.on("ready", () => { | ||
client.on("error", console.error) | ||
|
||
module.exports = { Falbot } | ||
try { | ||
mongoose.set("strictQuery", false) | ||
mongoose.connect(process.env.MONGODB_URI) | ||
} catch { | ||
console.log("A conexão caiu") | ||
mongoose.connect(process.env.MONGODB_URI) | ||
} | ||
|
||
mongoose.connection.on("error", (err) => { | ||
console.log(`Erro na conexão: ${err}`) | ||
mongoose.connect(process.env.MONGODB_URI) | ||
}) | ||
|
||
mongoose.connection.on("disconnected", () => { | ||
console.log("A conexão caiu") | ||
mongoose.connect(process.env.MONGODB_URI) | ||
}) | ||
|
||
mongoose.connection.on("disconnecting", () => { | ||
console.log("A conexão caiu") | ||
mongoose.connect(process.env.MONGODB_URI) | ||
}) | ||
|
||
mongoose.connection.on("MongoNetworkError", () => { | ||
console.log("A conexão caiu") | ||
mongoose.connect(process.env.MONGODB_URI) | ||
}) | ||
|
||
mongoose.connection.on("MongooseServerSelectionError", () => { | ||
console.log("A conexão caiu") | ||
mongoose.connect(process.env.MONGODB_URI) | ||
}) | ||
|
||
const wok = new WOKCommands(client, { | ||
commandsDir: path.join(__dirname, "/src/commands"), | ||
featuresDir: path.join(__dirname, "/src/events"), | ||
ignoreBots: true, | ||
ephemeral: false, | ||
botOwners: owners, | ||
testServers: someServers, | ||
defaultLanguage: language, | ||
messagesPath: path.join(__dirname, "/src/utils/json/messages.json"), | ||
disabledDefaultCommands: [ | ||
"language", | ||
"help", | ||
"command", | ||
"requiredrole", | ||
"channelonly", | ||
"prefix", | ||
], | ||
showWarns: false, | ||
}) | ||
|
||
wok._mongoConnection = mongoose.connection | ||
|
||
Falbot = new builder.Falbot(wok, client) | ||
|
||
module.exports = { Falbot } | ||
}) | ||
|
||
client.login(process.env.TOKEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.