-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
112 lines (96 loc) · 2.25 KB
/
types.d.ts
File metadata and controls
112 lines (96 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import type { Blop } from '@/structures'
import type {
APIApplicationCommandOption,
ChatInputCommandInteraction,
InteractionReplyOptions,
MessagePayload,
Snowflake
} from 'discord.js'
import type { Prisma } from './prisma/client'
import type { InitOptions as I18NextInitOptions, TOptions as I18NextTOptions } from 'i18next'
interface Language {
iso: string
localeName: string
aliases: string[]
}
interface APIItem {
baseUrl: string
}
type APIList = Record<string, APIItem>
export interface Config {
dirs?: {
commands?: string
events?: string
}
maintainers?: Snowflake[]
i18n?: {
languages: Language[]
options: I18NextInitOptions
}
apis?: APIList
fetch?: {
logChannelId?: Snowflake
}
}
export type User = Prisma.UserGetPayload<{
id: true
language: true
}>
export type Guild = Prisma.GuildGetPayload<{
id: true
modules: true
language: true
}>
interface ModuleConfig {
editable: boolean
enabled: boolean
}
export interface ModuleOptions {
[key: string]: ModuleConfig
}
export interface GuildChannelConfig {
[moduleId: string]: {
[channelType: string]: string | null
}
}
declare global {
namespace PrismaJson {
type GuildModules = ModuleOptions
type GuildChannels = GuildChannelConfig
}
}
export interface CommandOptions {
_filename: string
name: string
category?: string
description?: (context: CommandContext | PartialCommandContext) => string
options?: APIApplicationCommandOption[]
disabled?: boolean
cooldown?: number
}
export interface CommandContext {
client: Blop
interaction: ChatInputCommandInteraction<'cached'>
data: {
user: User
guild: Guild
}
}
export type PartialCommandContext = Omit<CommandContext, 'interaction' | 'data'> & {
interaction?: ChatInputCommandInteraction<'cached'>
data?: {
user: User
guild: Guild
}
}
export type CommandOutput = string | MessagePayload | InteractionReplyOptions | null | undefined | void | Promise<string | MessagePayload | InteractionReplyOptions | null | undefined | void>
declare module 'discord.js' {
interface BaseInteraction {
t(key: string, options: I18NextTOptions = {}): string
}
}
declare module 'i18next' {
interface TOptionsBase {
format?: 'uppercase' | 'capital' | 'lowercase'
}
}