Skip to content

Commit

Permalink
refactor(task-canteen-menu): remove deprecated usage of MessageEmbed#…
Browse files Browse the repository at this point in the history
…addField() & fix empty value
  • Loading branch information
Lutonite committed Sep 28, 2022
1 parent f0c5cfe commit b3d51f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scheduled-tasks/canteen-menu.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
type RawMenu,
} from '#src/utils/canteen-menu-utils';
import { findChannelByName } from '#src/utils/discord-collection-utils';
import { fieldValueOrEmpty } from '#src/utils/embed-utils';
import { capitalize } from '#src/utils/string-utils';
import { ApplyOptions } from '@sapphire/decorators';
import { ScheduledTask } from '@sapphire/plugin-scheduled-tasks';
Expand Down Expand Up @@ -59,7 +60,11 @@ export default class CanteenMenuTask extends ScheduledTask {

Object.entries(menu).forEach(([name, content]) => {
const title = `\`\`\`Menu ${capitalize(name)}\`\`\``;
embed.addField(title, content.join('\n'), true);
embed.addFields({
name: title,
value: fieldValueOrEmpty(content.join('\n')),
inline: true,
});
});

await channel.send({
Expand Down

0 comments on commit b3d51f9

Please sign in to comment.