mirror of
https://github.com/keanuplayz/TravBot-v3.git
synced 2024-08-15 02:33:12 +00:00
Compare commits
3 commits
45cb482826
...
ad82aef396
Author | SHA1 | Date | |
---|---|---|---|
|
ad82aef396 | ||
|
0e66735565 | ||
|
80deec025d |
6 changed files with 2683 additions and 6018 deletions
8608
package-lock.json
generated
8608
package-lock.json
generated
File diff suppressed because it is too large
Load diff
46
package.json
46
package.json
|
@ -15,40 +15,40 @@
|
||||||
"postinstall": "husky install"
|
"postinstall": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"canvas": "^2.7.0",
|
"canvas": "^2.8.0",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.2",
|
||||||
"discord.js": "^13.2.0",
|
"discord.js": "^13.3.0",
|
||||||
"figlet": "^1.5.0",
|
"figlet": "^1.5.2",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.2.0",
|
||||||
"inquirer": "^7.3.3",
|
"inquirer": "^8.2.0",
|
||||||
"mathjs": "^9.3.0",
|
"mathjs": "^9.5.1",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"ms": "^2.1.3",
|
"ms": "^2.1.3",
|
||||||
"onion-lasers": "npm:onion-lasers-v13@^2.0.0",
|
"onion-lasers": "npm:onion-lasers-v13@^2.1.0",
|
||||||
"pet-pet-gif": "^1.0.8",
|
"pet-pet-gif": "^1.0.9",
|
||||||
"relevant-urban": "^2.0.0",
|
"relevant-urban": "^2.0.0",
|
||||||
"translate-google": "^1.4.3",
|
"translate-google": "^1.5.0",
|
||||||
"weather-js": "^2.0.0"
|
"weather-js": "^2.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/figlet": "^1.5.0",
|
"@types/figlet": "^1.5.4",
|
||||||
"@types/glob": "^7.1.3",
|
"@types/glob": "^7.2.0",
|
||||||
"@types/inquirer": "^6.5.0",
|
"@types/inquirer": "^8.1.3",
|
||||||
"@types/jest": "^26.0.20",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/mathjs": "^6.0.11",
|
"@types/mathjs": "^9.4.1",
|
||||||
"@types/ms": "^0.7.31",
|
"@types/ms": "^0.7.31",
|
||||||
"@types/node": "^14.14.20",
|
"@types/node": "^16.11.6",
|
||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^8.2.0",
|
||||||
"husky": "^5.0.6",
|
"husky": "^7.0.4",
|
||||||
"jest": "^26.6.3",
|
"jest": "^27.3.1",
|
||||||
"prettier": "2.1.2",
|
"prettier": "2.4.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"ts-jest": "^26.4.4",
|
"ts-jest": "^27.0.7",
|
||||||
"tsc-watch": "^4.2.9",
|
"tsc-watch": "^4.5.0",
|
||||||
"typescript": "^4.4.4"
|
"typescript": "^4.4.4"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"fsevents": "^2.1.2"
|
"fsevents": "^2.3.2"
|
||||||
},
|
},
|
||||||
"author": "Keanu Timmermans",
|
"author": "Keanu Timmermans",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
14
repl.js
Normal file
14
repl.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
const discord = require("discord.js");
|
||||||
|
let bot = new discord.Client({
|
||||||
|
intents: [
|
||||||
|
discord.Intents.FLAGS.GUILDS,
|
||||||
|
discord.Intents.FLAGS.GUILD_MEMBERS,
|
||||||
|
discord.Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
|
||||||
|
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.DIRECT_MESSAGES
|
||||||
|
]
|
||||||
|
});
|
||||||
|
bot.login(require("./data/config.json").token);
|
|
@ -5,6 +5,7 @@ export default new NamedCommand({
|
||||||
channelType: CHANNEL_TYPE.GUILD,
|
channelType: CHANNEL_TYPE.GUILD,
|
||||||
async run({send, guild}) {
|
async run({send, guild}) {
|
||||||
const member = guild!.members.cache.random();
|
const member = guild!.members.cache.random();
|
||||||
send(`I love ${member.nickname ?? member.user.username}!`);
|
if (!member) return send("For some reason, an error occurred fetching a member.");
|
||||||
|
return send(`I love ${member.nickname ?? member.user.username}!`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import {TextChannel} from "discord.js";
|
||||||
import {Command, getUserByNickname, NamedCommand, confirm, RestCommand} from "onion-lasers";
|
import {Command, getUserByNickname, NamedCommand, confirm, RestCommand} from "onion-lasers";
|
||||||
import {pluralise} from "../../../lib";
|
import {pluralise} from "../../../lib";
|
||||||
import {Storage} from "../../../structures";
|
import {Storage} from "../../../structures";
|
||||||
|
@ -20,7 +21,13 @@ export const DailyCommand = new NamedCommand({
|
||||||
{
|
{
|
||||||
title: "Daily Reward",
|
title: "Daily Reward",
|
||||||
description: "You received 1 Mon!",
|
description: "You received 1 Mon!",
|
||||||
color: ECO_EMBED_COLOR
|
color: ECO_EMBED_COLOR,
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "New balance:",
|
||||||
|
value: pluralise(user.money, "Mon", "s")
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -29,10 +36,9 @@ export const DailyCommand = new NamedCommand({
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
title: "Daily Reward",
|
title: "Daily Reward",
|
||||||
description: `It's too soon to pick up your daily Mons. You have about ${(
|
description: `It's too soon to pick up your daily Mons. Try again at <t:${Math.floor(
|
||||||
(user.lastReceived + 79200000 - now) /
|
(user.lastReceived + 79200000) / 1000
|
||||||
3600000
|
)}:t>.`,
|
||||||
).toFixed(1)} hours to go.`,
|
|
||||||
color: ECO_EMBED_COLOR
|
color: ECO_EMBED_COLOR
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -62,9 +62,17 @@ export function getSendEmbed(sender: User, receiver: User, amount: number): obje
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAuthorized(guild: Guild | null, channel: TextBasedChannels): boolean {
|
export function isAuthorized(guild: Guild | null, channel: TextBasedChannels): boolean {
|
||||||
if ((guild?.id === "637512823676600330" && channel?.id === "669464416420364288") || IS_DEV_MODE) return true;
|
if (IS_DEV_MODE) {
|
||||||
else {
|
return true;
|
||||||
channel.send("Sorry, this command can only be used in Monika's emote server. (#mon-stocks)");
|
}
|
||||||
|
|
||||||
|
if (guild?.id !== "637512823676600330") {
|
||||||
|
channel.send("Sorry, this command can only be used in Monika's emote server.");
|
||||||
|
return false;
|
||||||
|
} else if (channel?.id !== "669464416420364288") {
|
||||||
|
channel.send("Sorry, this command can only be used in <#669464416420364288>.");
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue