TravBot-v3/src/commands/fun/eco.ts

40 lines
1.5 KiB
TypeScript
Raw Normal View History

import {Command, NamedCommand, callMemberByUsername} from "../../core";
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";
import {MondayCommand} from "./modules/eco-extras";
import {BetCommand} from "./modules/eco-bet";
export default new NamedCommand({
2020-12-15 01:44:28 +00:00
description: "Economy command for Monika.",
async run({guild, channel, author}) {
if (isAuthorized(guild, channel)) channel.send(getMoneyEmbed(author));
},
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,
bet: BetCommand
},
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.",
2020-12-15 01:44:28 +00:00
async run({guild, channel, args}) {
2020-12-15 07:56:09 +00:00
if (isAuthorized(guild, channel)) channel.send(getMoneyEmbed(args[0]));
2020-12-15 01:44:28 +00:00
}
}),
any: new Command({
2020-12-15 07:56:09 +00:00
description: "See how much money someone else has by using their username.",
async run({guild, channel, args, message}) {
2020-12-15 01:44:28 +00:00
if (isAuthorized(guild, channel))
callMemberByUsername(message, args.join(" "), (member) => {
channel.send(getMoneyEmbed(member.user));
});
}
})
});