Skip to content

Commit 4c9e2c1

Browse files
ebm5025Ed Morgan
andauthored
Fix long park button name exception (#230)
* Fix long park button name exception * Revert "Fix long park button name exception" This reverts commit 982a35d. * Truncate long strings --------- Co-authored-by: Ed Morgan <edwardmorgan706@gmail.com>
1 parent d053491 commit 4c9e2c1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/features/raid-bots/park-bot-button-command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import { BOT_SPREADSHEET_COLUMNS } from "../../services/sheet-updater/public-sheet";
1414
import { log } from "../../shared/logger";
1515
import { getMember } from "../..";
16+
import { truncate } from "lodash";
1617

1718
export class ParkBotButtonCommand extends ButtonCommand {
1819
constructor(name: string) {
@@ -53,7 +54,7 @@ import { getMember } from "../..";
5354
public getButtonBuilder(bot: bot): ButtonBuilder {
5455
return new ButtonBuilder()
5556
.setLabel(
56-
`Park ${bot.name} at ${bot.location}`
57+
truncate(`Park ${bot.name} at ${bot.location}`, {length: 80})
5758
)
5859
.setCustomId(this.customId)
5960
.setStyle(ButtonStyle.Success);

src/services/openDkpService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
openDkpAuctionRaidId,
2424
} from "../config";
2525
import { EmbedBuilder } from "discord.js";
26-
import { round } from "lodash";
26+
import { round, truncate } from "lodash";
2727
import { log } from "../shared/logger";
2828

2929
// Client for OpenDKP
@@ -542,7 +542,7 @@ export const openDkpService = {
542542

543543
descriptions.push(cleanTickName);
544544
}
545-
const embedTitle = descriptions.join(", ");
545+
const embedTitle = truncate(descriptions.join(", "), {length: 255});
546546
const raidData = {
547547
Attendance: 1,
548548
Items: items,

0 commit comments

Comments
 (0)