2021-04-17 15:21:17 +00:00
|
|
|
import {Command, NamedCommand, getUserByNickname, RestCommand} from "onion-lasers";
|
2021-03-31 03:22:25 +00:00
|
|
|
import {isAuthorized, getMoneyEmbed} from "./modules/eco-utils";
|
|
|
|
import {DailyCommand, PayCommand, GuildCommand, LeaderboardCommand} from "./modules/eco-core";
|
|
|
|
import {BuyCommand, ShopCommand} from "./modules/eco-shop";
|
2021-04-08 11:37:49 +00:00
|
|
|
import {MondayCommand, AwardCommand} from "./modules/eco-extras";
|
2021-04-07 06:43:39 +00:00
|
|
|
import {BetCommand} from "./modules/eco-bet";
|
2020-11-04 08:04:07 +00:00
|
|
|
|
2021-04-05 04:35:12 +00:00
|
|
|
export default new NamedCommand({
|
2020-12-15 01:44:28 +00:00
|
|
|
description: "Economy command for Monika.",
|
2021-04-10 13:34:55 +00:00
|
|
|
async run({send, guild, channel, author}) {
|
|
|
|
if (isAuthorized(guild, channel)) send(getMoneyEmbed(author));
|
2020-11-04 08:04:07 +00:00
|
|
|
},
|
2020-12-15 01:44:28 +00:00
|
|
|
subcommands: {
|
|
|
|
daily: DailyCommand,
|
|
|
|
pay: PayCommand,
|
|
|
|
guild: GuildCommand,
|
2020-12-15 11:15:28 +00:00
|
|
|
leaderboard: LeaderboardCommand,
|
2020-12-15 01:44:28 +00:00
|
|
|
buy: BuyCommand,
|
2020-12-16 07:24:26 +00:00
|
|
|
shop: ShopCommand,
|
2021-01-25 22:06:12 +00:00
|
|
|
monday: MondayCommand,
|
2021-04-08 11:37:49 +00:00
|
|
|
bet: BetCommand,
|
|
|
|
award: AwardCommand,
|
|
|
|
post: new NamedCommand({
|
|
|
|
description: "A play on `eco get`",
|
|
|
|
run: "`405 Method Not Allowed`"
|
|
|
|
})
|
2020-11-04 08:04:07 +00:00
|
|
|
},
|
2021-04-06 06:15:17 +00:00
|
|
|
id: "user",
|
2020-12-15 01:44:28 +00:00
|
|
|
user: new Command({
|
2020-12-15 07:56:09 +00:00
|
|
|
description: "See how much money someone else has by using their user ID or pinging them.",
|
2021-04-10 13:34:55 +00:00
|
|
|
async run({send, guild, channel, args}) {
|
|
|
|
if (isAuthorized(guild, channel)) send(getMoneyEmbed(args[0]));
|
2020-12-15 01:44:28 +00:00
|
|
|
}
|
|
|
|
}),
|
2021-04-10 17:07:55 +00:00
|
|
|
any: new RestCommand({
|
2020-12-15 07:56:09 +00:00
|
|
|
description: "See how much money someone else has by using their username.",
|
2021-04-11 09:11:21 +00:00
|
|
|
async run({send, guild, channel, combined}) {
|
2021-04-10 11:41:48 +00:00
|
|
|
if (isAuthorized(guild, channel)) {
|
2021-04-17 15:21:17 +00:00
|
|
|
const user = await getUserByNickname(combined, guild);
|
|
|
|
if (typeof user !== "string") send(getMoneyEmbed(user));
|
|
|
|
else send(user);
|
2021-04-10 11:41:48 +00:00
|
|
|
}
|
2020-12-15 01:44:28 +00:00
|
|
|
}
|
|
|
|
})
|
2020-11-04 08:04:07 +00:00
|
|
|
});
|