Skip to content

Commit

Permalink
Fix(FieldsEmbed): Strict field strings only
Browse files Browse the repository at this point in the history
- Fixes #69

Signed-off-by: gazmull <[email protected]>
  • Loading branch information
gazmull committed Aug 3, 2021
1 parent fe8dd35 commit 1e90d2b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/FieldsEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ export class FieldsEmbed<Element> extends PaginationEmbed<Element> {
this.embed.fields = [];

for (const field of fields)
if (typeof field.value === 'function')
this.formatField(field.name, field.value, field.inline);
else
this.embed.addField(field.name, field.value, field.inline);
this.embed.fields.push(field);

const hasPaginateField = this.embed.fields.filter(f => typeof f.value === 'function').length;

Expand Down Expand Up @@ -127,10 +124,12 @@ export class FieldsEmbed<Element> extends PaginationEmbed<Element> {
}

protected async _drawList () {
const fields = this.embed.fields;
this.embed.fields = [];
const embed = new MessageEmbed(this.embed);
embed.fields = [];
this.embed.fields = fields;

for (const field of this.embed.fields)
for (const field of fields)
embed.addField(
field.name,
typeof field.value === 'function'
Expand Down

0 comments on commit 1e90d2b

Please sign in to comment.