Skip to content

Commit

Permalink
Merge bf0aa35 into b785e64
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Apr 11, 2024
2 parents b785e64 + bf0aa35 commit eac3f36
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,6 @@ Array [
],
"type": "carousel",
},
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"type": "flex",
},
],
Expand Down
78 changes: 0 additions & 78 deletions src/webhook/handlers/__tests__/singleUserHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,6 @@ it('handles postbacks w/ LegacyContext', async () => {
Object {
"messages": Array [
Object {
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"text": "Postback results here",
"type": "text",
},
Expand Down Expand Up @@ -288,19 +275,6 @@ it('rejects outdated postback events', async () => {
Object {
"messages": Array [
Object {
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"text": "🚧 You are currently searching for another message, buttons from previous search sessions do not work now.",
"type": "text",
},
Expand Down Expand Up @@ -380,19 +354,6 @@ it('forwards to CHOOSING_ARTICLE when VIEW_ARTICLE_PREFIX is sent', async () =>
Object {
"messages": Array [
Object {
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"text": "Choosing article resp",
"type": "text",
},
Expand Down Expand Up @@ -452,19 +413,6 @@ it('shows reply list when article URL is sent', async () => {
Object {
"messages": Array [
Object {
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"text": "Choosing article resp",
"type": "text",
},
Expand Down Expand Up @@ -545,19 +493,6 @@ it('Resets session on free-form input, triggers fast-forward', async () => {
Object {
"messages": Array [
Object {
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"text": "Replies here",
"type": "text",
},
Expand Down Expand Up @@ -614,19 +549,6 @@ it('handles tutorial trigger from rich menu', async () => {
Object {
"messages": Array [
Object {
"quickReply": Object {
"items": Array [
Object {
"action": Object {
"label": "來謠言惑眾獎投票吧!",
"type": "uri",
"uri": "https://www.mygopen.com/p/award_22.html",
},
"imageUrl": "/static/img/mygopen-award-2024.png?cachebust=1",
"type": "action",
},
],
},
"text": "Tutorial here",
"type": "text",
},
Expand Down
18 changes: 0 additions & 18 deletions src/webhook/handlers/singleUserHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,6 @@ const singleUserHandler = async (
})
);

// Attach MyGoPen award as quick reply
const lastReply = result.replies[result.replies.length - 1];
if (!lastReply.quickReply) {
lastReply.quickReply = {
items: [
{
type: 'action',
imageUrl: `${process.env.RUMORS_LINE_BOT_URL}/static/img/mygopen-award-2024.png?cachebust=1`,
action: {
type: 'uri',
uri: 'https://www.mygopen.com/p/award_22.html',
label: '來謠言惑眾獎投票吧!',
},
},
],
};
}

// Send replies. Does not need to wait for lineClient's callbacks.
// lineClient's callback does error handling by itself.
//
Expand Down
Binary file removed static/img/mygopen-award-2024.png
Binary file not shown.

0 comments on commit eac3f36

Please sign in to comment.