it runs now
This commit is contained in:
parent
1e8e9d8c78
commit
a4d08f0696
@ -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
13
src/cb.ts
Normal 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
5
src/cbclient.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { CommandClient } from "./commandclient";
|
||||||
|
|
||||||
|
export class CBClient extends CommandClient {
|
||||||
|
|
||||||
|
}
|
@ -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(),
|
||||||
|
@ -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
33
src/slash/randomcase.ts
Normal 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;
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user