-
Notifications
You must be signed in to change notification settings - Fork 5
/
messages.ts
670 lines (660 loc) · 25.6 KB
/
messages.ts
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
import Info from "./src/Info";
import * as Discord from "discord.js";
import { CustomCommandsField } from "./src/Database";
export function raw(string: TemplateStringsArray | string): {__raw: string} {
return { __raw: `${string.toString()}` };
}
export function templateGenerator<InType>(helper: (str: InType) => string):
(strings: TemplateStringsArray | InType, ...values: (InType | string | { __raw: string })[]) =>
string {
type ValueArrayType = (InType | string | { __raw: string })[];
return (
strings: TemplateStringsArray | InType,
...values: ValueArrayType
): string => {
if (!(strings as TemplateStringsArray).raw && !Array.isArray(strings)) {
return helper(strings as InType);
}
const result: ValueArrayType = [];
(strings as TemplateStringsArray).forEach((str, i) => {
result.push(raw(str), values[i] || "");
});
return result
.map(el =>
typeof (el as { __raw: string }).__raw === "string"
? (el as { __raw: string }).__raw
: helper(el as InType),
)
.join("");
};
}
/// joins a list in english
/// eg One / One or Two / One, Two, or Three / One, Two, Three, or Four
/// joiner is 'and' or 'or'
export function humanizelist(
items: readonly string[],
joiner: string,
empty = "*Empty list oops*",
): string {
if (items.length === 0) return empty;
if (items.length === 1) return items[0];
if (items.length === 2) return items.join(" " + joiner + " ");
return items
.map((a, i): string => (i === items.length - 1 ? "or " : "") + a)
.join(", ");
}
export const orlist = (items: readonly string[], empty?: string): string =>
humanizelist(items, "or", empty);
export const andlist = (items: readonly string[], empty?: string): string =>
humanizelist(items, "and", empty);
export const plural = (text: any[] | number): string =>
(typeof text === "number" ? text : text.length) === 1 ? "" : "s";
export const safe = templateGenerator((str: string) =>
str
// oh that's funny
// this is incorrect
// it should be `<|>|\[|\]|"|` not `<|>|\[|\]"|`
.replace(/(\*|_|`|~|\\|<|>|\[|\]"|'|\(|\)|:)/g, "\\$1")
.replace(/everyone/g, "every\u200bone")
.replace(/here/g, "he\u200bre"),
);
const shownon: { [key: string]: true | undefined } = {};
export const messages = {
role: (role: Discord.Role): string => {
if (
role.mentionable ||
role.guild.members.me!.permissions.has("MentionEveryone")
)
return safe`${`@${role.name}`}`;
return role.toString();
},
nd: (number: number): string =>
number +
(number > 10 && number < 20 // 12th, 13th, 14th
? "th"
: `${number}`.endsWith("1") // 1st, 21st
? "st"
: `${number}`.endsWith("2") // 2nd, 52nd
? "nd"
: `${number}`.endsWith("3") // 3rd, 23rd
? "rd"
: "th"),
arguments: {
channel_arg_not_provided: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The ${messages.nd(
index,
)} argument to this command must be a channel${purpose}. Mention a channel by typing # and selecting a channel, or use the channel ID.
> **Using Channels in Commands**: <https://interpunct.info/channel-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
emoji_arg_not_provided: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The ${messages.nd(
index + 1,
)} argument to this command must be an emoji${purpose}. Use an emoji by selecting it from the emoji menu, or use the emoji's id.
> **Using Emojis in Commands**: <https://interpunct.info/emoji-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
word_arg_not_provided: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The ${messages.nd(
index + 1,
)} argument to this command must be a word.${purpose}
> **Using Words in Commands**: <https://interpunct.info/word-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
words_arg_not_provided: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The last argument to this command must be the message${purpose}
> **Using in Commands**: <https://interpunct.info/words-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
role_arg_not_provided: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The last argument to this command must be the role name, @mention, or id${purpose}
> **Using Roles in Commands**: <https://interpunct.info/role-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
channel_not_found: (
info: Info,
channelID: string,
index: number,
commandhelp: string,
): string => `The channel with the ID ${channelID} could not be found. Make sure the ${messages.nd(
index + 1,
)} argument to this command has a real channel on this server.
> **Using Channels in Commands**: <https://interpunct.info/channel-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
emoji_not_found: (
info: Info,
channelID: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The emoji with the ID ${channelID} could not be found. Make sure the ${messages.nd(
index + 1,
)} argument to this command has a real emoji on this server.
> **Using Emojis in Commands**: <https://interpunct.info/emoji-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
role_name_not_provided: (
info: Info,
roleID: string,
index: number,
commandhelp: string,
): string => `The role in the last argument could not be found.
> **Using Roles in Commands**: <https://interpunct.info/role-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
multiple_roles_found: (
rolename: string,
matchingRoles: Discord.Role[],
): string =>
`There are ${
matchingRoles.length
} roles named ${safe`${rolename}`}. Either rename the others or use a Role ID.
> ${matchingRoles
.map(
r =>
messages.role(r) +
(matchingRoles.length <= 4 ? " (`" + r.id + "`)" : ""),
)
.join(", ")}`,
multiple_roles_found_fuzzy: (
rolename: string,
matchingRoles: Discord.Role[],
): string => `There are ${
matchingRoles.length
} roles with names similar to ${safe`${rolename}`}. Either be more specific or use a Role ID.
> ${matchingRoles
.map(
r =>
messages.role(r) +
(matchingRoles.length <= 4 ? " (`" + r.id + "`)" : ""),
)
.join(", ")}`,
no_roles_found: (
info: Info,
rolename: string,
index: number,
commandhelp: string,
): string => `I could not find any roles named ${safe`${rolename}`}. Check your spelling or directly copy and paste the name. If that doesn't work, use a Role ID.
> **Using Roles in Commands**: <https://interpunct.info/role-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
role_this_should_never_happen: (): string => ``,
num_arg_not_provided: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `The ${messages.nd(
index + 1,
)} argument to this command must be a number.${purpose}
> **Using Numbers in Commands**: <https://interpunct.info/number-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
num_is_nan: (
info: Info,
cmd: string,
index: number,
commandhelp: string,
purpose: string,
): string => `I could not find a number in the ${messages.nd(
index + 1,
)} argument to this command.${purpose}
> **Using Numbers in Commands**: <https://interpunct.info/number-arg>${
commandhelp ? `\n${commandhelp}` : ""
}`,
},
emoji: {
failure: "<:failure_2:508841130503438356>",
success: "<:success_2:508840840416854026>",
restrict_usage: (info: Info): string =>
`Usage: \`${info.prefix}emoji restrict\`<:emoji:685668888842993833>\` Role\`
> Role can be a role name, id, or mention.
> **More Info**: <https://interpunct.info/emoji>`,
could_not_find_emoji: (
info: Info,
emojiID: string,
): string => safe`Could not find emoji with the ID ${emojiID}.
> **More Info**: <https://interpunct.info/emoji>`,
role_does_not_exist: (
info: Info,
roleID: string,
): string => safe`Could not find role with the ID ${roleID}.
> **More Info**: <https://interpunct.info/emoji>`,
multiple_roles_found: (
info: Info,
roleName: string,
roles: Discord.Role[],
): string => safe`There are multiple roles named ${
roleName.startsWith("@") ? roleName : `@${roleName}`
}. Use the ID of the role you meant instead. <https://interpunct.info/role>
Found Roles:
${roles
.map(
r =>
safe`- **ID**: ${r.id}, **Name**: ${`@${r.name}`}, **Color**: ${
r.hexColor
}\n`,
)
.join("")}> **More Info**: <https://interpunct.info/emoji>`,
no_roles_found: (info: Info, roleName: string): string =>
`No role could be found with the name ${
roleName.startsWith("@") ? roleName : `@${roleName}`
}. Try using the role ID instead: <https://interpunct.info/role>
> **More Info**: <https://interpunct.info/emoji>`,
added_restriction: (
info: Info,
emoji: Discord.GuildEmoji,
addedRole: Discord.Role,
fullList: Discord.Role[],
): string =>
`Role ${messages.role(
addedRole,
)} added to restrictions for ${emoji.toString()}. This emoji can now only be used by members with any of these roles:
${fullList.map(role => `- ${role.toString()}\n`).join("")}
> If this was a mistake, reset the restrictions for this emoji with \`${
info.prefix
}emoji unrestrict ${emoji.id}\``,
removed_restriction: (
info: Info,
emoji: Discord.GuildEmoji,
removedRole: Discord.Role,
fullList: Discord.Role[],
): string =>
`Role ${removedRole.toString()} removed from restrictions for ${emoji.toString()}. This emoji can now only be used by members with any of these roles:
${fullList.map(role => `- ${role.toString()}\n`).join("")}
> If this was a mistake, reset the restrictions for this emoji with \`${
info.prefix
}emoji unrestrict ${emoji.id}\``,
removed_all_restrictions: (info: Info, emoji: Discord.GuildEmoji): string =>
`Removed all restrictions for ${emoji.toString()}. Anyone can now use this emoji.`,
inspect: (
info: Info,
emoji: Discord.GuildEmoji,
): string => `**Emoji ${emoji.toString()}**:
${
[...emoji.roles.cache.values()].length > 0
? `This emoji can only be used by members with at least one of these roles:
${[...emoji.roles.cache
.values()]
.map(role => `- ${role.toString()}\n`)
.join("")}`
: ""
}**Image**: ${emoji.url}`,
},
failure: {
command_cannot_be_used_in_pms: (info: Info): string =>
`This command cannot be used in PMs!
> **Support Server**: <https://interpunct.info/support>
> **About this Error**: <https://interpunct.info/command-cannot-be-used-in-pms>`,
command_must_use_pms: (info: Info): string =>
`PM me to use this command.
> **Support Server**: <https://interpunct.info/support>
> **About this Error**: <https://interpunct.info/command-must-use-pms>`,
generic_internal_error: (info: Info, errorCode: string): string =>
`An internal error occured while running this command.
For help, ask on the support server with your error code \`${errorCode}\`
> **Support Server**: <https://interpunct.info/support>
> **Error Code**: \`${errorCode}\``,
missing_permissions_internal_error: (info: Info, errorCode: string): string =>
`${info.atme} does not have some of the permissions it needs to run this command.
For help, ask on the support server with your error code \`${errorCode}\`
> **Support Server**: <https://interpunct.info/support>
> **Error Code**: \`${errorCode}\``,
command_not_found: (info: Info, command: string): string =>
safe`Command \`${info.prefix}${command}\` not found. Type \`${raw(
info.prefix,
)}help\` for a list of commands.` +
// (info.authorPerms.REMOVETHIS &&
// !shownon[info.message.channel.id + "|" + info.message.author.id]
// ? ((shownon[
// info.message.channel.id + "|" + info.message.author.id
// ] = true),
// "\n> Don't want to see this? Disable this message with `" +
// safe`${info.prefix}set showunknowncommand never` +
// "`.")
// : ""),
"", // too bad you don't get the notice anymore
command_removed: (
info: Info,
old: string,
version: string,
description?: string,
): string =>
safe`The command \`${
info.prefix
}${old}\` has been removed as part of inter·punct bot version ${version}.${raw(
description ? `\n\n${description}` : "",
)}
> Join the support server to complain if this removal affects you: <https://interpunct.info/support>`,
},
settings: {
autospace_enabled: (info: Info): string =>
`When you make a new channel or edit an existing channel, all dashes will be replaced with spaces. To disable this, use
\`\`\`
${info.prefix}space channels disable
\`\`\``,
autospace_disabled: (info: Info): string =>
`Channels will no longer have spaces added to their names.`,
show_errors_set: (
info: Info,
showErrors: "always" | "admins" | "never",
unknownCommandMessages: "always" | "admins" | "never",
): string =>
showErrors === "always"
? `Errors will be shown to all users.${
unknownCommandMessages === "never"
? `\n> Unknown command errors are currently hidden. To show them for admins or all users, use \`${info.prefix}set showunknowncommand always\` or \`${info.prefix}set showunknowncommand admins\``
: ""
}`
: showErrors === "admins"
? `Bot errors will only be shown to members with the \`Manage Server\` permission.${
unknownCommandMessages === "always"
? `\n> Unknown command errors will still be shown to all users. To show them for admins or disable them entirely, use \`${info.prefix}set show unknowncommand admins\` or \`${info.prefix}set showunknowncommand never\``
: ""
}`
: showErrors === "never"
? `Bot errors will never be shown. If a command is not working and not giving any output, try re-enabling command errors with \`${
info.prefix
}set show errors always\`.${
unknownCommandMessages === "always"
? `\n> Unknown command errors will still be shown to all users. To show them for admins only or disable them entirely, use \`${info.prefix}set show unknown command admins\` or \`${info.prefix}set show unknown command never\``
: ""
}`
: `this should never happen`,
no_prefix_provided: (info: Info): string =>
safe`The current prefix for this server is ${info.prefix}. To change it, use \`${info.prefix}set prefix new_prefix\``,
prefix_updated: (info: Info, newPrefix: string): string =>
safe`Prefix changed to ${newPrefix}.\n> Try it out with \`${newPrefix}test\`.`,
show_errors_usage: (
info: Info,
showErrors: "always" | "admins" | "never",
): string =>
`Error messages are currently ${
showErrors === "always"
? "shown to all users"
: showErrors === "admins"
? "shown to members with the `Manage Server` permission"
: showErrors === "never"
? "never shown"
: "this should never happen"
}. To change this, use \`${
info.prefix
}set show errors always|admins|never\``,
unknown_commands_set: (
info: Info,
unknownCommandMessages: "always" | "admins" | "never",
showErrors: "always" | "admins" | "never",
): string =>
unknownCommandMessages === "always"
? `Unknown command messages will be shown to all users.`
: unknownCommandMessages === "admins"
? `Unknown command messages will only be shown to members with the \`Manage Server\` permission.`
: unknownCommandMessages === "never"
? `Unknown command messages will be hidden. If a command is not working and not giving any output, try re-enabling unknown command messages with \`${info.prefix}set show unknown command always\``
: `this should never happen`,
unknown_commands_usage: (
info: Info,
unknownCommandMessages: "always" | "admins" | "never",
): string =>
`Unknown command messages are currently ${
unknownCommandMessages === "always"
? "shown to all users"
: unknownCommandMessages === "admins"
? "shown to members with the `Manage Server` permission"
: unknownCommandMessages === "never"
? "never shown"
: "this should never happen"
}. To change this, use \`${
info.prefix
}set show unknown command always|admins|never\``,
},
logging: {
attach_files: (info: Info): string =>
`${info.atme} needs permission to \`Attach Files\` to upload your log file here.
> More Info: <https://interpunct.info/logging>`,
upload_probably_failed: (info: Info, errorCode: string): string =>
`(Probably) Failed to upload the log file. For help, join the support server and ask with your error code \`${errorCode}\`.
> More Info: <https://interpunct.info/logging>
> Support Server: <https://discord.gg/HVWCeXc>`,
log_sent: (info: Info): string =>
`
> Use \`${info.prefix}log reset\` to clear the log and start a new one.`,
},
speedrun: {
requires_setup: (info: Info): string =>
`Speedrun commands have not been set up on this server. Set them up with \`${info.prefix}speedrun set https://speedrun.com/game Category Name\`.
> More Info: <https://interpunct.info/speedrun>`,
invalid_category_name: (
info: Info,
categoryName: string,
categoryNames: string[],
): string =>
safe`The category ${categoryName} is not on the selected game. Valid categories are: ${categoryNames.join(
", ",
)}.
> More Info: <https://interpunct.info/speedrun>`,
no_wr_found: (info: Info): string => `No world record found.
> More Info: <https://interpunct.info/speedrun>`,
no_run_for_position: (
info: Info,
position: number,
): string => `No run found in ${messages.nd(position)} place.
> More Info: <https://interpunct.info/speedrun>`,
position_required: (info: Info): string =>
`A position is required, such as \`${info.prefix}speedrun leaderboard 26\`
> More Info: <https://interpunct.info/speedrun>`,
},
fun: {
fun_disabled: (info: Info): string => `Fun is not allowed on this server.`,
ping: (info: Info): string => `<a:pingpong:482012177725653003>
> Took ${new Date().getTime() - info.other!.startTime}ms, handling ${
info.other!.infoPerSecond
} db requests per second`,
command_not_found: (info: Info): string =>
`Usage: \`${info.prefix} fun enable|disable\`.
> More Info: <https://interpunct.info/fun>`,
fun_has_been_enabled: (info: Info): string => `Fun enabled.
> Try it out with \`ip!${
["minesweeper", "connect4", "checkers", "trivia"][
Math.floor(Math.random() * 4)
]
}\``,
fun_has_been_disabled: (info: Info): string =>
`Fun is no longer allowed on this server.`,
minesweeper_usage: (
info: Info,
difficulties: string[],
modes: string[],
): string => `Usage: \`${info.prefix}minesweeper [optional ${difficulties.join(
"|",
)} = medium] [optional ${modes.join(
"|",
)} = customemojis] [optional WIDTHxHEIGHT = 10x10] [optional difficulty% = 15%]\`
> More Info: <https://interpunct.info/minesweeper>`,
},
lists: {
list_exists_but_not_really: (info: Info, listName: string): string =>
`The list ${listName} does not exist.
> More Info: <https://interpunct.info/lists>`,
failed_to_get_list: (info: Info): string =>
`Failed to download list from pastebin.
> More Info: <https://interpunct.info/lists>`,
nothing_found_for_search: (info: Info, searchString: string[]): string =>
`No results for ${searchString.join(" ")}.`,
list_lists: (info: Info, lists: CustomCommandsField): string =>
`**Lists**:
${Object.entries(lists)
.map(([key, value]) =>
value.type === "list"
? `> ${key}: <https://pastebin.com/${value.pastebin}>`
: value.type === "sendpanel"
? `> ${key}: sendpanel ${value.guild_command_name}`
: `> ${key}: ${value.text.substring(0, 25).replace(/\n/g, "") +
(value.text.length > 25 ? "..." : "")}`,
)
.join(`\n`) || "> *No lists yet. Create some with {Command|lists add}*"}`,
no_list_name_provided: (
info: Info,
): string => `A list name and pastebin URL is required. For example: \`${info.prefix}lists add listname pastebin.com/NFuKYjUN\`
> More Info: <https://interpunct.info/lists>`,
list_already_exists: (
info: Info,
listName: string,
pastebinUrl: string,
): string =>
`Command ${listName} already exists, edit it with \`${info.prefix}lists edit ${listName} ${pastebinUrl}\` or delete it with \`${info.prefix}lists delete ${listName}\`
> More Info: <https://interpunct.info/lists>`,
list_does_not_exist: (
info: Info,
listName: string,
pastebinUrl: string,
): string =>
`List ${listName} does not exist, add it with \`lists add ${listName} ${pastebinUrl}\`
> More Info: <https://interpunct.info/lists>`,
invalid_pastebin_url: (info: Info, listName: string): string =>
`A valid pastebin URL is required as the second argument to this command. For example: \`${info.prefix}lists add ${listName} https://pastebin.com/NFuKYjUN\`.
> More Info: <https://interpunct.info/lists>`,
add_successful: (info: Info, listName: string, pastebinID: string): string =>
`Added list ${listName} with pastebin URL <https://pastebin.com/${pastebinID}>
Try it out with \`${info.prefix}${listName}\``,
edit_succesful: (info: Info, listName: string, pastebinID: string): string =>
`Updated list ${listName} with new pastebin URL <https://pastebin.com/${pastebinID}>
Try it out with \`${info.prefix}${listName}\``,
remove_list_that_does_not_exist: (info: Info, listName: string): string =>
`There is no list named ${listName}. See a list of lists using \`${info.prefix}lists list\`.
> More Info: <https://interpunct.info/lists>`,
remove_list_succesful: (info: Info, listName: string): string =>
`List ${listName} removed.`,
},
channels: {
purge: {
message_limit: (info: Info, messageLimit: number): string =>
!messageLimit
? `A message limit must be given, such as \`${info.prefix}purge 25\``
: messageLimit < 1
? `Message limit must be positive.`
: messageLimit > 100
? `Message limit must be between 1 and 100`
: `Message limit must be an integer.`,
in_progress: (info: Info, messagesToDelete: number): string =>
`Deleting ${messagesToDelete} messages...`,
success: (info: Info, messagesToDelete: number, skip_count: number): string =>
`Succesfully deleted ${messagesToDelete} messages.` + (skip_count != 0 ? " (Skipped "+skip_count+" pinned messages)" : ""),
},
spacing: {
no_channels_to_space: (info: Info): string =>
`**There are no channels to put spaces in!**
To add spaces to a channel, put dashes (\`-\`) where you want the spaces to go or replace a custom character using
\`\`\`
${info.prefix}space channels \`_\`
\`\`\`
> More Info: <https://interpunct.info/spacing-channels>`,
succeeded_spacing: (info: Info, channels: Discord.Channel[]): string =>
`The channel${plural(channels)} ${andlist(
channels.map(c => c.toString()),
)} now have spaces.`,
autospace_info_off: (info: Info): string =>
`> If you want channels to automatically have spaces in the future, use \`${info.prefix}space channels automatically\``,
autospace_info_on: (info: Info): string =>
`Channels should be given spaces automatically because you have \`ip!space channels enable\`d.`,
partially_succeeded_spacing: (
info: Info,
channels: Discord.Channel[],
failedChannels: Discord.Channel[],
): string =>
`The channel${plural(channels)} ${andlist(
channels.map(c => c.toString()),
)} now have spaces.
The channel${plural(failedChannels)} ${andlist(
failedChannels.map(c => c.toString()),
)} could not be given spaces. Maybe ${
info.atme
} does not have permission to Manage Channels?
If you wanted spaces in these channels, check the channel settings to see if ${
info.atme
} has permission to manage them.
> Discord Support: <https://support.discordapp.com/hc/en-us/articles/206029707-How-do-I-set-up-Permissions->
> Command Help: <https://interpunct.info/spacing-channels>`,
failed_spacing: (info: Info, failedChannels: Discord.Channel[]): string =>
`The channel${plural(failedChannels)} ${andlist(
failedChannels.map(c => c.toString()),
)} could not be given spaces. Maybe ${
info.atme
} does not have permission to Manage Channels?
If you wanted spaces in these channels, check the channel settings to see if ${
info.atme
} has permission to manage them.
> Discord Support: <https://support.discordapp.com/hc/en-us/articles/206029707-How-do-I-set-up-Permissions->
> Command Help: <https://interpunct.info/spacing-channels>`,
},
send_many: {
no_channels_tagged: (info: Info): string =>
`**No channels were tagged!**
To send a message to multiple channels, tag every channel you want to send the message to, like this:
\`\`\`
${info.prefix}send This is my great message! #rules #general
\`\`\`
> More Info: <https://interpunct.info/sending-messages-to-multiple-channels>`,
succeeded_sending: (info: Info, channels: Discord.Channel[]): string =>
`Your message was sent to ${andlist(
channels.map(c => c.toString()),
)}.`,
partially_succeeded_sending: (
info: Info,
channels: Discord.Channel[],
failedChannels: Discord.Channel[],
): string =>
`Your message was sent to ${andlist(
channels.map(c => c.toString()),
)}.
It could not be sent to ${orlist(
failedChannels.map(c => c.toString()),
)}. Maybe ${
info.atme
} does not have permission to Read and Send Messages there?
Check the channel settings to see if ${
info.atme
} has permission to read and send messages.
> Discord Support: <https://support.discordapp.com/hc/en-us/articles/206029707-How-do-I-set-up-Permissions->
> Command Help: <https://interpunct.info/sending-messages-to-multiple-channels>`,
failed_sending: (info: Info, failedChannels: Discord.Channel[]): string =>
`Your message could not be sent to ${orlist(
failedChannels.map(c => c.toString()),
)}. Maybe ${
info.atme
} does not have permission to Read and Send Messages there?
Check the channel settings to see if ${
info.atme
} has permission to read and send messages.
> Discord Support: <https://support.discordapp.com/hc/en-us/articles/206029707-How-do-I-set-up-Permissions->
> Command Help: <https://interpunct.info/sending-messages-to-multiple-channels>`,
},
},
};