Skip to content

Commit

Permalink
feat: improve the hello-action UI
Browse files Browse the repository at this point in the history
Signed-off-by: Raymond Feng <[email protected]>
  • Loading branch information
raymondfeng committed Feb 27, 2023
1 parent 4633444 commit 1b17d26
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 64 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@collabland/models": "^0.24.0",
"@loopback/core": "^4.0.8",
"@loopback/rest": "^12.0.8",
"discord-api-types": "^0.37.32",
"discord-api-types": "^0.37.35",
"discord.js": "^14.7.1",
"tslib": "^2.0.0"
},
Expand Down
40 changes: 35 additions & 5 deletions src/__tests__/acceptance/hello-action-ecdsa.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,46 @@ describe('HelloAction - ecdsa', () => {
options: [
{
name: 'your-name',
description: "Name of person we're greeting",
description: 'Name of person we\'re greeting',
type: 3,
required: true,
},
],
},
autocomplete: true
}
]
}
]);
expect(result.response).to.eql({
type: 4,
data: {content: 'Hello, John!', flags: 64},
data: {
content: 'Hello, John!',
embeds: [
{
title: 'Hello Action',
color: 16106056,
author: {
name: 'Collab.Land',
url: 'https://collab.land',
icon_url: 'https://cdn.discordapp.com/app-icons/715138531994894397/8a814f663844a69d22344dc8f4983de6.png'
},
description: 'This is demo Collab.Land action that adds `/hello-action` command to your Discord server. Please click the `Count down` button below to proceed.',
url: 'https://github.com/abridged/collabland-hello-action/'
}
],
components: [
{
type: 1,
components: [
{
type: 2,
label: 'Count down',
style: 1,
custom_id: 'hello-action:count-button'
}
]
}
],
flags: 64
}
});
});
});
42 changes: 36 additions & 6 deletions src/__tests__/acceptance/hello-action-ed25519.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('HelloAction - ed25519', () => {
await app.stop();
});

it('invokes action with ecdsa signature', async () => {
it('invokes action with ed25519 signature', async () => {
const result = await client(
app.restServer.url + '/hello-action',
'ed25519:' + signingKey,
Expand All @@ -39,16 +39,46 @@ describe('HelloAction - ed25519', () => {
options: [
{
name: 'your-name',
description: "Name of person we're greeting",
description: 'Name of person we\'re greeting',
type: 3,
required: true,
},
],
},
autocomplete: true
}
]
}
]);
expect(result.response).to.eql({
type: 4,
data: {content: 'Hello, John!', flags: 64},
data: {
content: 'Hello, John!',
embeds: [
{
title: 'Hello Action',
color: 16106056,
author: {
name: 'Collab.Land',
url: 'https://collab.land',
icon_url: 'https://cdn.discordapp.com/app-icons/715138531994894397/8a814f663844a69d22344dc8f4983de6.png'
},
description: 'This is demo Collab.Land action that adds `/hello-action` command to your Discord server. Please click the `Count down` button below to proceed.',
url: 'https://github.com/abridged/collabland-hello-action/'
}
],
components: [
{
type: 1,
components: [
{
type: 2,
label: 'Count down',
style: 1,
custom_id: 'hello-action:count-button'
}
]
}
],
flags: 64
}
});
});
});
Loading

0 comments on commit 1b17d26

Please sign in to comment.