Skip to content

Commit 2aeb07a

Browse files
committed
Add thumbnail
1 parent 72ae782 commit 2aeb07a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/commands/inventar.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
ComponentType,
88
ContainerBuilder,
99
MessageFlags,
10+
SectionBuilder,
1011
SlashCommandBuilder,
1112
TextDisplayBuilder,
1213
type User,
@@ -53,6 +54,8 @@ export default class InventarCommand implements ApplicationCommand {
5354
b.createdAt.localeCompare(a.createdAt),
5455
);
5556

57+
const circle = await drawBbCircle(new Set(contents.map(i => i.lootKindId)));
58+
5659
let lastPageIndex = Math.floor(contents.length / pageSize);
5760
lastPageIndex -= contents.length % pageSize === 0 ? 1 : 0;
5861

@@ -77,7 +80,8 @@ export default class InventarCommand implements ApplicationCommand {
7780

7881
return {
7982
components: [
80-
new ContainerBuilder()
83+
new SectionBuilder()
84+
.setThumbnailAccessory(t => t.setURL("attachment://circle.png"))
8185
.addTextDisplayComponents(t => t.setContent(`## Inventar von ${user}`))
8286
.addTextDisplayComponents(
8387
...listItems.map(li => new TextDisplayBuilder().setContent(li)),
@@ -108,6 +112,12 @@ export default class InventarCommand implements ApplicationCommand {
108112
flags: MessageFlags.IsComponentsV2,
109113
withResponse: true,
110114
tts: false,
115+
files: [
116+
{
117+
attachment: circle,
118+
name: "circle.png",
119+
},
120+
],
111121
});
112122

113123
const message = callbackResponse.resource?.message;

0 commit comments

Comments
 (0)