it runs now

This commit is contained in:
Hexugory 2023-03-28 23:28:37 -05:00
parent 1e8e9d8c78
commit a4d08f0696
7 changed files with 59 additions and 5 deletions

View File

@ -2,10 +2,10 @@
"name": "2023collectabot", "name": "2023collectabot",
"version": "1.0.0", "version": "1.0.0",
"description": "stupid", "description": "stupid",
"main": "out/mud.js", "main": "out/cb.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"start": "node ./out/mud.js" "start": "node ./out/cb.js"
}, },
"author": "Collectabot Team", "author": "Collectabot Team",
"license": "MIT", "license": "MIT",

13
src/cb.ts Normal file
View File

@ -0,0 +1,13 @@
import { GatewayIntentBits, Partials } from "discord.js";
import { CBClient } from "./cbclient";
import { db } from "./database";
const Client = new CBClient({
intents: [
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages
],
partials: [Partials.Channel]
}, db);

5
src/cbclient.ts Normal file
View File

@ -0,0 +1,5 @@
import { CommandClient } from "./commandclient";
export class CBClient extends CommandClient {
}

View File

@ -1,10 +1,11 @@
import { BlacklistCommand } from "./blacklist"; import { BlacklistCommand } from "./blacklist";
import { Command } from "./command";
import { DeploySlashCommand } from "./deployslash"; import { DeploySlashCommand } from "./deployslash";
import { GlobalBlacklistCommand } from "./gblacklist"; import { GlobalBlacklistCommand } from "./gblacklist";
import { KillCommand } from "./kill"; import { KillCommand } from "./kill";
import { RandomCaseCommand } from "./randomcase"; import { RandomCaseCommand } from "./randomcase";
export const CommandList = [ export const CommandList: Command[] = [
new GlobalBlacklistCommand(), new GlobalBlacklistCommand(),
new BlacklistCommand(), new BlacklistCommand(),
new RandomCaseCommand(), new RandomCaseCommand(),

View File

View File

@ -1,4 +1,6 @@
import { RandomCaseCommand } from "./randomcase";
import { SlashCommand } from "./slash";
export const SlashCommandList = [ export const SlashCommandList: SlashCommand[] = [
//new Command() new RandomCaseCommand()
]; ];

33
src/slash/randomcase.ts Normal file
View File

@ -0,0 +1,33 @@
import { ApplicationCommandOptionData, ApplicationCommandOptionType, CommandInteraction } from "discord.js"
import { createArgumentsObject, SlashCommand } from "./slash"
interface RandomCaseArguments {
string: string
}
export class RandomCaseCommand implements SlashCommand {
name = 'randomcase'
description = 'dOEs thIs'
permission = []
ownerOnly = false
guildOnly = false
args: ApplicationCommandOptionData[] = [
{
name: 'string',
type: ApplicationCommandOptionType.String,
description: 'some words',
required: true
}
]
async execute(int: CommandInteraction) {
const args = createArgumentsObject(int.options.data) as RandomCaseArguments;
var strSplit = args.string.toLowerCase().split('');
for(let [i, char] of strSplit.entries()){
if (Math.random() > 0.5) strSplit[i] = char.toUpperCase();
}
int.reply(strSplit.join(''));
return;
}
};