ahegao 1.69.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ ////////////////////////////////////////////////////////////////////////////////////
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Maybe = void 0;
5
+ class Maybe {
6
+ constructor(value) {
7
+ this.value = value;
8
+ this.present = value != null;
9
+ }
10
+ orElseGet(value) {
11
+ if (this.present) {
12
+ return this.value;
13
+ }
14
+ return value();
15
+ }
16
+ orElse(value) {
17
+ if (this.present) {
18
+ return this.value;
19
+ }
20
+ return value;
21
+ }
22
+ }
23
+ exports.Maybe = Maybe;
24
+ (function (Maybe) {
25
+ Maybe.EMPTY = new Maybe(null);
26
+ function fromArray(valuesArray, index) {
27
+ if (index >= 0 && index < valuesArray.length) {
28
+ return new Maybe(valuesArray[index]);
29
+ }
30
+ return Maybe.EMPTY;
31
+ }
32
+ Maybe.fromArray = fromArray;
33
+ function of(value) {
34
+ if (value == null) {
35
+ return Maybe.EMPTY;
36
+ }
37
+ return new Maybe(value);
38
+ }
39
+ Maybe.of = of;
40
+ })(Maybe || (exports.Maybe = Maybe = {}));
41
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":";AAAA,oFAAoF;;;AA8BpF,MAAa,KAAK;IAId,YAA4B,KAAe;QAAf,UAAK,GAAL,KAAK,CAAU;QAEvC,IAAI,CAAC,OAAO,GAAG,KAAK,IAAI,IAAI,CAAA;IAChC,CAAC;IAED,SAAS,CAAC,KAAc;QAEpB,IAAG,IAAI,CAAC,OAAO,EACf,CAAC;YACG,OAAO,IAAI,CAAC,KAAU,CAAA;QAC1B,CAAC;QACD,OAAO,KAAK,EAAE,CAAA;IAClB,CAAC;IAED,MAAM,CAAC,KAAQ;QAEX,IAAG,IAAI,CAAC,OAAO,EACf,CAAC;YACG,OAAO,IAAI,CAAC,KAAU,CAAA;QAC1B,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC;CACJ;AA1BD,sBA0BC;AAED,WAAiB,KAAK;IAEL,WAAK,GAAe,IAAI,KAAK,CAAM,IAAI,CAAC,CAAA;IAErD,SAAgB,SAAS,CAAI,WAAgB,EAAE,KAAa;QAExD,IAAG,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,EAC3C,CAAC;YACG,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;QACxC,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAA;IACtB,CAAC;IAPe,eAAS,YAOxB,CAAA;IAED,SAAgB,EAAE,CAAI,KAAe;QAEjC,IAAG,KAAK,IAAI,IAAI,EAChB,CAAC;YACG,OAAO,KAAK,CAAC,KAAK,CAAA;QACtB,CAAC;QACD,OAAO,IAAI,KAAK,CAAI,KAAK,CAAC,CAAA;IAC9B,CAAC;IAPe,QAAE,KAOjB,CAAA;AACL,CAAC,EArBgB,KAAK,qBAAL,KAAK,QAqBrB"}
@@ -0,0 +1,195 @@
1
+ import { ApplicationCommandOptionChoiceData, ApplicationCommandOptionData, Attachment, BaseMessageOptions, CategoryChannel, Channel, ChannelType, Client, Collection, CommandInteraction, Embed, EmbedBuilder, EmojiIdentifierResolvable, Guild, GuildMember, Message, MessageCreateOptions, MessageReaction, MessageReference, PartialMessage, RawFile, Role, RoleData, RoleManager, RoleResolvable, Snowflake, TextBasedChannel, TextChannel, ThreadChannel, User, UserResolvable } from "discord.js";
2
+ import { StringCount, StringStringMap } from "../types/types";
3
+ export declare const BLANK_RUNNABLE: () => void;
4
+ export type DynamicDateFormat = "F" | //Long Date With Day Of Week And Short Time
5
+ "f" | //Long Date With Short Time
6
+ "D" | //Long Date
7
+ "d" | //Short Date
8
+ "T" | //Long Time
9
+ "t" | //Short Time
10
+ "R";
11
+ export declare const DYNAMIC_DATE_REGEX: RegExp;
12
+ export declare const COMMAND_START_REGEX: RegExp;
13
+ export declare const COMMAND_AT_START_OF_STRING_REGEX: RegExp;
14
+ export declare const COMMAND_NOT_ALLOWED_IN_DEV_MESSAGE = "The bot is currently in Dev mode; This command is not available in Dev mode!";
15
+ export declare const ONLY_TEXT_CHANNEL_SUPPORTED = "Only TextChannel supported!";
16
+ export declare const DISCORD_EMOJI_REGEX: RegExp;
17
+ export declare const DISCORD_ANY_PING_REGEX: RegExp;
18
+ export declare const DISCORD_USER_PING_REGEX: RegExp;
19
+ export declare const USELESS_LINK_METADATA_REGEX: RegExp;
20
+ export declare const URL_REGEX: RegExp;
21
+ export declare const FILLER_AND_NASTY_REGEX: RegExp;
22
+ export declare const DISCORD_MESSAGE_LINK_REGEX: RegExp;
23
+ export declare const DISCORD_MESSAGE_LINKS_REGEX: RegExp;
24
+ export declare const REPLY_REFERENCE_MAX_LENGTH = 152;
25
+ export declare const LIST_90_DEG = "\u2514";
26
+ export type MessageType = Message<boolean> | PartialMessage;
27
+ export type UserOrMember = User | GuildMember;
28
+ export interface StringChannelMap {
29
+ [key: string]: Channel;
30
+ }
31
+ export interface ExtendedInteraction extends CommandInteraction {
32
+ member: GuildMember;
33
+ }
34
+ export declare const CHECKMARK = "\u2705";
35
+ export declare const UWU_FACES: string[];
36
+ export declare const FALSE_KEYWORDS: Set<string>;
37
+ export declare const TRUE_KEYWORDS: Set<string>;
38
+ export declare function math(args: number | string, id?: string, givenType?: string, minutes?: boolean): string;
39
+ export declare function calc(args: number | string, minutes?: boolean): number;
40
+ export declare function formatNumber(number: number, id?: Snowflake, givenType?: string): string;
41
+ export declare function scrollEmpty(scrollAmount?: number): string;
42
+ export interface Definition {
43
+ category?: string;
44
+ definition: string;
45
+ }
46
+ export declare function defineWord(word: string, lang: string): Promise<Definition>;
47
+ export declare function makeEmbed(title: string, description: string, color?: number): EmbedBuilder;
48
+ export declare function makeMessage(embeds: EmbedBuilder | EmbedBuilder[]): BaseMessageOptions;
49
+ export declare function makeEmbedMessage(title: string, description: string, color?: number): BaseMessageOptions;
50
+ export declare function isChannelThread(channel: Channel): boolean;
51
+ export declare function makeGuildLink(guildId: Snowflake): string;
52
+ export declare function makeChannelLink(guildId: Snowflake, channelId: Snowflake): string;
53
+ export declare function makeMessageLinkFromMessage(message: Message<boolean>): string;
54
+ export declare function makeMessageLink(guildId: Snowflake | null, channelId: Snowflake, messageId: Snowflake): string;
55
+ export declare function makeEmbedTextAsLink(text: string, link: string): string;
56
+ export declare function userIdToPing(userId: Snowflake): string;
57
+ export declare function objsToCommandChoices<T extends {}>(objs: T[], nameGetter: (obj: T) => string, valueGetter: (obj: T) => string): ApplicationCommandOptionChoiceData<string>[];
58
+ export declare function objToCommandChoices<T extends {}>(obj: T, nameGetter: (obj: T) => string, valueGetter: (obj: T) => string): ApplicationCommandOptionChoiceData<string>;
59
+ export declare function asCommandChoices(keys: any[]): ApplicationCommandOptionChoiceData<string>[];
60
+ export declare function getOrFromKeys(stringCount: StringCount, keyName: string): [StringStringMap];
61
+ export declare function commitSeppuku(): void;
62
+ export declare function getStringAsNumberOrDefault(interaction: CommandInteraction, name: string, defaultValue: number): number;
63
+ export declare function getBooleanOrDefault(interaction: CommandInteraction, name: string, defaultValue: boolean): boolean;
64
+ export declare function newSet<K, Holds>(collection: Collection<K, Holds>): Set<Holds>;
65
+ export declare function getOrDefaultProperty<T>(interaction: CommandInteraction, key: string, defaultValue: T): T;
66
+ export declare function isDev(): boolean;
67
+ export declare function isProduction(): boolean;
68
+ export declare function sanitizeDiscordMessage(message: string, hideFiller?: boolean): string;
69
+ export declare function unhideMessage(url: string): string;
70
+ export declare function isTextBasedChannel(channel: Channel): channel is TextBasedChannel;
71
+ export declare function isNotTextChannel(channel: Channel): channel is Exclude<any, TextBasedChannel>;
72
+ export declare function getCuteName(index: number): string;
73
+ export declare function getRandomHeartEmoji(amount?: number): string;
74
+ export declare function getRandomPetname(): string;
75
+ export declare function getCuteIconUrl(index: number): string;
76
+ export declare function getRandomUwuFace(): string;
77
+ export declare function getIsACommandString(word: string): string;
78
+ export declare function getDontHavePermissionString(): string;
79
+ export declare function getCuteNameForThisDay(user: UserOrMember): string;
80
+ export declare function getCuteIconUrlForThisDay(user: UserOrMember): string;
81
+ export declare function getNameWhereOptions(name: string): {
82
+ where: {
83
+ name: string;
84
+ };
85
+ };
86
+ export declare function getIdArrayWhereOptions(ids: number[]): {
87
+ where: {
88
+ id: {
89
+ in: number[];
90
+ };
91
+ };
92
+ };
93
+ export declare function getIdWhereOptions(id: number): {
94
+ where: {
95
+ id: number;
96
+ };
97
+ };
98
+ export declare function getUserIdWhereOptions(userId: string): {
99
+ where: {
100
+ userId: string;
101
+ };
102
+ };
103
+ export declare function getUserName(user: UserOrMember | null): string;
104
+ export declare function getMemberName(member: GuildMember): string;
105
+ export declare function getMemberNameOrElseUserName(member: GuildMember | null, user: User): string;
106
+ export declare function getMemberNameOrElseUserNameFromMessage(message: Message<boolean>): string;
107
+ export declare function getMemberNameOrElseUserNameFromInteraction(interaction: CommandInteraction): string;
108
+ export declare function makeClickableText(text: string, url: string): string;
109
+ export declare function updateChannelDescriptionIfDoesntMatch(channel: TextChannel, description: string): Promise<boolean>;
110
+ export declare function isStringFalse(text: string): boolean;
111
+ export declare function isStringTrue(text: string): boolean;
112
+ export declare function attachmentsToUrls(attachments: Collection<Snowflake, Attachment>): string[];
113
+ export declare function attachmentsToFiles(attachments: Collection<Snowflake, Attachment>): string[];
114
+ export declare function attachmentsToRawFiles(attachments: Collection<Snowflake, Attachment>): RawFile[];
115
+ export declare function messageToMessageCreateOptions(message: Message<boolean>): MessageCreateOptions;
116
+ export interface NameAndId {
117
+ name: string;
118
+ id: Snowflake;
119
+ }
120
+ export declare function toRainbowedAcronym(name: string, key?: string): string;
121
+ export declare function itemToRainbowedAcronym(item: NameAndId): string;
122
+ export declare function messageToIdentifier(message: Message<boolean>): string;
123
+ export declare function toMessageIdentifier(guild: Guild | null, channel?: Channel, author?: User): string;
124
+ export declare function toNameValueChoice(text: string): {
125
+ name: string;
126
+ value: string;
127
+ };
128
+ export declare function toNameNumberValueOption(text: string, description?: string, required?: boolean): ApplicationCommandOptionData;
129
+ export declare function toNameStringValueOption(text: string, description?: string, required?: boolean): ApplicationCommandOptionData;
130
+ export declare function toNameValueOption(text: string, type: number, description?: string, required?: boolean): ApplicationCommandOptionData;
131
+ export declare function forEachMessage(channel: TextChannel | ThreadChannel, consumer: (message: Message<boolean>) => Promise<void | boolean>, referenceMsg?: Message<boolean>, after?: boolean): Promise<void>;
132
+ export declare function offsetDate(date: Date, hourOffset: number): Date;
133
+ export declare function newDate(offsetMs?: number): Date;
134
+ export declare function dateToDynamicDate(date: Date, format?: DynamicDateFormat): string;
135
+ export declare function msToDynamicDate(ms: number, format?: DynamicDateFormat): string;
136
+ export declare function sToDynamicDate(seconds: number, format?: DynamicDateFormat): string;
137
+ export declare function getCannotAccessString(itemName: string): string;
138
+ export declare function getInvalidString(itemName: string): string;
139
+ export declare function getMissingString(itemName: string): string;
140
+ export declare function getMissingIdString(): string;
141
+ export declare function getMissingContentString(): string;
142
+ export declare function getMissingCommandString(): string;
143
+ export declare function getMissingSubCommandString(): string;
144
+ export declare function getMissingSubCommandsCommandString(): string;
145
+ export declare function getMissingNameString(type?: string | null): string;
146
+ export declare function getCheckOurDMsString(): string;
147
+ export declare function getIDontKnowThisPersonString(): string;
148
+ export declare function getMessageCannotBeEmptyString(): string;
149
+ export declare function bringRoleToTop(role: Role): Promise<boolean>;
150
+ export declare function renameGuildOrChannel(item: Guild | TextChannel | ThreadChannel, name: string): Promise<void>;
151
+ export declare function renameMember(member: GuildMember, name: string): Promise<void>;
152
+ export declare function rename(item: Guild | TextBasedChannel | GuildMember, name: string): Promise<void>;
153
+ export declare function hasBot(users: Iterable<User>, bot: Client): boolean;
154
+ export declare function hasUser(users: Iterable<User>, checkedUser: User): boolean;
155
+ export declare function hasUserId(users: Iterable<User>, userId: Snowflake): boolean;
156
+ export declare function hasAnyNotBot(users: Iterable<User>): boolean;
157
+ export declare function hasEmojiByUserId(reaction: MessageReaction, userId: Snowflake): boolean;
158
+ export declare function setChannelPrivate(channel: TextChannel | CategoryChannel, makePrivate: boolean, to?: RoleResolvable | UserResolvable): Promise<void>;
159
+ export declare const INVALID_CHANNEL_NAME_CHARS_REGEX: RegExp;
160
+ export declare function sanitizeChannelName(name: string): string;
161
+ export declare function channelMatches(channel: Channel, channelType: ChannelType, name: string): boolean;
162
+ export declare function getOrCreateTextChannel(guild: Guild, name: string, parent?: CategoryChannel | null): Promise<TextChannel>;
163
+ export declare function getOrCreateThreadChannel(channel: TextChannel, name: string, parent?: CategoryChannel | null): Promise<ThreadChannel>;
164
+ export declare function getOrCreateCategory(guild: Guild, name: string): Promise<CategoryChannel>;
165
+ export declare function getCategoryChannels(categoryChannel: CategoryChannel): Promise<StringChannelMap>;
166
+ export declare function discordCrossOut(input: string): string;
167
+ export declare function discordUnderline(input: string): string;
168
+ export declare function discordBold(input: string, thiccness?: number): string;
169
+ export declare function dateFromDynamicDate(dynamicDate: string): Date | null;
170
+ export declare function referenceToUrl(reference: MessageReference): string;
171
+ export declare function react(message: MessageType, emoji: EmojiIdentifierResolvable, timeout?: number): Promise<void>;
172
+ export declare function parseDiscordMessageLinks(input: string): MessageReference[];
173
+ export declare function parseFirstDiscordMessageLink(input: string): MessageReference | null;
174
+ export declare function isChannelPublic(channel: TextChannel): boolean;
175
+ export declare function messageToReference(message: MessageType): MessageReference;
176
+ export declare function messageLinkToReference(messageLink: string): MessageReference | null;
177
+ export declare function getMessageById(channel: TextBasedChannel, messageId: Snowflake): Promise<Message<boolean> | undefined>;
178
+ export declare function wrapTitle(text: any): string;
179
+ export declare function isAttachmentSpoiler(attachment: Attachment): boolean;
180
+ export declare function isStringSpoiler(text: string): boolean;
181
+ export declare function messageToReplyString(message: MessageType): string;
182
+ export declare function timeAndUserIdToEmbedBuilder(timeMs: number, userId: Snowflake, content?: string): EmbedBuilder;
183
+ export declare function filterUselessMetadata(url: string): string;
184
+ export declare function isTextChannel(channel: Channel): channel is TextChannel;
185
+ export declare function embedToString(embed: Embed): string;
186
+ export declare function getAllChannels(guild: Guild): Promise<Set<Channel>>;
187
+ export declare function arrayToDisplayUpToString<T>(items: T[], mapper: (item: T) => string, maxDisplayCount?: number): string;
188
+ export declare function debugLog(input: any): void;
189
+ export declare function backupToGit(): Promise<string>;
190
+ export interface RoleDataWithId extends RoleData {
191
+ id?: Snowflake;
192
+ }
193
+ export declare function getOrCreateRole(roleManager: RoleManager, data: RoleDataWithId): Promise<Role | undefined>;
194
+ export declare function getRoleById(roleManager: RoleManager, roleId: Snowflake): Promise<Role | undefined>;
195
+ export declare function tooLongForDiscord(input: string | number | string[]): boolean;