This repository was archived by the owner on Jul 30, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
104 lines (94 loc) · 2.82 KB
/
Copy pathindex.js
File metadata and controls
104 lines (94 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Important Definitions
const Discord = require("discord.js");
const { CommandoClient } = require("discord.js-commando");
const path = require("path");
const client = new CommandoClient({
commandPrefix: "h!",
owner: "410839910204047360",
invite: "https://discord.gg/4Xv6CDY"
});
client.registry
.registerGroups([["basic", "Basic"], ["fun", "Fun"], ["misc", "Misc"], ["owner", "Owner Only"]])
.registerCommandsIn(path.join(__dirname, "commands"));
// Not-That-Important Definitions
const randomPuppy = require("random-puppy");
const urban = require("urban");
const weather = require("weather.js");
const Canvas = require("canvas");
const { MongoClient } = require("mongodb");
const MongoDBProvider = require("commando-provider-mongo").MongoDBProvider;
const AutoPoster = require("topgg-autoposter");
const ap = AutoPoster(process.env.TOPGG, client);
const fetch = require("node-fetch");
const express = require("express");
const app = express();
const cheweyBotAnalyticsAPI = require("discord-bot-analytics");
const customAnalytics = new cheweyBotAnalyticsAPI(
process.env.CHEYWEYAPI,
client
);
var owner = "Raymond#2829";
var commandPrefix = "r!";
// Console Logging
client.once("ready", () => {
console.log("Ready!");
console.log(
`The bot is currently serving ${client.users.cache.size} users, in ${client.guilds.cache.size} servers.`
);
client.user
.setPresence({
activity: { name: "h!help | hackerman14.tk | COMMANDO!" },
status: "dnd"
})
.then(presence =>
console.log(`Activity is set to "${presence.activities[0].name}"!`)
)
.catch(console.error);
});
client.once("reconnecting", () => {
console.log("Reconnecting!");
});
client.once("disconnect", () => {
console.log("Disconnect!");
});
client.on("warn", console.warn);
client.on("error", console.error);
client.on("uncaughtException", err => {
console.log(err);
process.exit(1);
});
ap.on("posted", () => {
console.log("Posted stats to Top.gg!");
});
ap.on("error", e => {
console.log(`An error occurred to TOP.gg! ${e}`);
});
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
// Client Codes & Rules
client.on("message", async message => {
let msg = message.content.toLowerCase();
if (message.author.bot) return;
if (!message.guild) return;
if (!message.content.startsWith(commandPrefix)) return;
var args = message.content.split(" ").slice(1);
const channel = message.channel;
});
client.login(process.env.DISCORD);
// Functions
function showError(message, err) {
message.channel.send({
embed: {
color: Math.floor(Math.random() * 16777214) + 1,
title: "**Boring Facts**",
description: "f",
timestamp: new Date(),
footer: {
text: "Made with ❤️ created by " + owner
}
}
});
}