Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
vKxni committed Sep 3, 2023
0 parents commit 1943b2e
Show file tree
Hide file tree
Showing 11 changed files with 631 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
*.doxc
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "kts",
"version": "1.0.0",
"description": "'Kigaposts starter'",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"test": "tsc && node dist/index.js"
},
"keywords": [],
"author": "vKxni",
"license": "MIT",
"dependencies": {
"discord.js": "^14.13.0"
},
"devDependencies": {
"@types/node": "^20.5.9",
"typescript": "^5.2.2"
}
}
204 changes: 204 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Utils } from "./utils";

const content: string = "test";

Utils.createDocxFile("test", content);
const validate = Utils.doesDocxFileExist("test");

console.log(validate);
145 changes: 145 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import {
Snowflake,
ApplicationCommandDataResolvable,
PermissionResolvable,
Collection,
} from "discord.js";

type SnowflakeOrString = Snowflake | string;

interface RunOptions<T extends Record<string, any>> {
client: ExtendedClient;
interaction: T;
args: string[];
}

type RunFunction<T extends Record<string, any>> = (options: RunOptions<T>) => unknown;

interface ExtendedInteraction<T> {
member: T;
options: Record<string, any>;
}

interface ExtendedButtonInteraction<T> {
member: T;
fields: Record<string, any>;
}

interface CommandOptions {
userPermissions?: PermissionResolvable[];
guildOnly?: boolean;
ownerOnly?: boolean;
directory?: string;
description?: string;
}

type CommandType<T extends Record<string, any>> = ApplicationCommandDataResolvable & {
run: RunFunction<T>;
options?: CommandOptions;
};

interface Verification {
enabled: boolean;
blacklisted: boolean;
visitor: boolean | null;
isVerified: boolean | null;
}

interface VerificationData {
_id: string;
userID: string;
klasse: string;
email: string;
status: VerificationRequestStatus;
requestedCodes: boolean;
recoveryCodes: string[];
createdAt: Date;
updatedAt: Date;
__v: number;
}

interface VerificationFormFields {
"input-klasse": string;
"input-email": string;
}

type VerificationRequestStatus = "N/A" | "Accepted" | "Declined";

interface VerificationRequest {
userID: SnowflakeOrString;
klasse: string;
email: string;
status: VerificationRequestStatus;
}

interface Datenschutz {
data: VerificationData;
hasRequestedCodes: boolean;
hasDeletedData: boolean;
}

interface ServerStats {
online: number;
members: number;
verifiedMembers: number;
footer: Array<[string, Date]>;
}

interface KigaPosts {
_id: string;
guildID: string;
enabled: boolean;
holiday: boolean;
postChannel: string;
__v: number;
}

interface KigaPostData extends KigaPosts {
messageID: string;
description: string;
avatarURL: string;
footerText: string;
}

interface AutoResponse {
_id: string;
guildID: string;
enabled: boolean;
trigger: {
trigger: string;
response: string;
}[];
}

type MyCollection<T> = Collection<string, T>;

interface ExtendedClient {
commands: MyCollection<any>;
buttons: MyCollection<any>;
modals: MyCollection<any>;
cooldowns: MyCollection<any>;
verification: MyCollection<any>;
autoResponses: MyCollection<any>;
kigaPosts: MyCollection<any>;
}

export {
SnowflakeOrString,
RunOptions,
RunFunction,
ExtendedInteraction,
ExtendedButtonInteraction,
CommandOptions,
CommandType,
Verification,
VerificationData,
Datenschutz,
ServerStats,
KigaPosts,
KigaPostData,
AutoResponse,
VerificationFormFields,
VerificationRequest,
MyCollection,
ExtendedClient,
};
Loading

0 comments on commit 1943b2e

Please sign in to comment.