Skip to content

Commit bf2ba7a

Browse files
authored
Add info that you can thank several people in one message (#81)
* add info that you can thank several people in one message * fix thx tests
1 parent 0d5c9c5 commit bf2ba7a

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/thx.spec.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ import { getMessageMock } from '../test/mocks';
55

66
describe('thx', () => {
77
let id = 0;
8+
const msgReply = 'protip: napisz `@nazwa ++`, żeby komuś podziękować! Możesz podziękować kilku osobom w jednej wiadomości!';
89

910
it('it should ignore random messages', async () => {
1011
const msg = getMessageMock('msg', { content: 'msg', channel: { id: ++id } });
1112
msg.reply.resolves();
1213

1314
await thx(msg as unknown as Discord.Message);
1415

15-
expect(msg.reply).not.to.have.been.calledOnceWith(
16-
'protip: napisz `@nazwa ++`, żeby komuś podziękować!',
17-
);
16+
expect(msg.reply).not.to.have.been.calledOnceWith(msgReply);
1817
});
1918

2019
it('it should respond to thanks', async () => {
@@ -23,9 +22,7 @@ describe('thx', () => {
2322

2423
await thx(msg as unknown as Discord.Message);
2524

26-
expect(msg.reply).to.have.been.calledOnceWith(
27-
'protip: napisz `@nazwa ++`, żeby komuś podziękować!',
28-
);
25+
expect(msg.reply).to.have.been.calledOnceWith(msgReply);
2926
});
3027

3128
[
@@ -42,9 +39,7 @@ describe('thx', () => {
4239
msg.reply.resolves();
4340
await thx(msg as unknown as Discord.Message);
4441

45-
expect(msg.reply).not.to.have.been.calledOnceWith(
46-
'protip: napisz `@nazwa ++`, żeby komuś podziękować!',
47-
);
42+
expect(msg.reply).not.to.have.been.calledOnceWith(msgReply);
4843
}),
4944
);
5045
});

src/thx.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ export const thx = (msg: Discord.Message) => {
2121
}
2222

2323
thxTimeoutCache.set(msg.channel.id, new Date());
24-
console.log(msg.content);
25-
return msg.reply('protip: napisz `@nazwa ++`, żeby komuś podziękować!');
24+
return msg.reply('protip: napisz `@nazwa ++`, żeby komuś podziękować! Możesz podziękować kilku osobom w jednej wiadomości!');
2625
};

0 commit comments

Comments
 (0)