Skip to content

Commit

Permalink
fix bot username
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Nov 8, 2021
1 parent 16763c0 commit ce498df
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion test/helpers/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ module.exports = {
};
}
if (!user) {
user = { userName: 'bot' };
user = { userName: '__bot__' };
}
user = _.cloneDeep(user);
return until(setError => {
Expand Down
2 changes: 1 addition & 1 deletion test/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ global.mock
},
{
'from_id': '12345',
'from_name': 'bot',
'from_name': '__bot__',
'to_id': '23161357',
'to_name': 'LIRIK',
'followed_at': String(new Date()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Bets - @func3 - bet should automatically be locked after given time wi
});

it('Bet should properly announce lock', async () => {
await message.isSentRaw('Betting time is up! No more bets.', 'bot', 20000);
await message.isSentRaw('Betting time is up! No more bets.', '__bot__', 20000);
});

it('Bet should be locked in db', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Commons - @func2 - #3620 - announce is not parsing message filters', (

it('Announce() should have propery parsed filters', async () => {
announce('Prikazy bota: !klip, !me, !heist, (list.!command), (list.!alias)', 'general');
await message.isSentRaw('Prikazy bota: !klip, !me, !heist, !testCmd, !testAlias', 'bot', 20000);
await message.isSentRaw('Prikazy bota: !klip, !me, !heist, !testCmd, !testAlias', '__bot__', 20000);

});
});
8 changes: 4 additions & 4 deletions test/tests/customvariable/postURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ describe('Custom Variable - helpers/customvariables/postURL - @func1', () => {
assert.strictEqual(res._toSend.value, '100');
assert.strictEqual(res._toSend.code, undefined);
assert.strictEqual(res._status, 200);
await message.isNotSentRaw('@bot, $_variable2 was set to 101.', 'bot');
await message.isNotSentRaw('This is custom update text: 101', 'bot');
await message.isNotSentRaw('@bot, $_variable2 was set to 101.', '__bot__');
await message.isNotSentRaw('This is custom update text: 101', '__bot__');
});

it ('with enabled POST and response type 0 - correct value', async () => {
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('Custom Variable - helpers/customvariables/postURL - @func1', () => {
assert.strictEqual(res._toSend.value, '101');
assert.strictEqual(res._toSend.code, undefined);
assert.strictEqual(res._status, 200);
await message.isSentRaw('@bot, $_variable2 was set to 101.', 'bot');
await message.isSentRaw('@bot, $_variable2 was set to 101.', '__bot__');
});

it ('with enabled POST and response type 1 - correct value', async () => {
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('Custom Variable - helpers/customvariables/postURL - @func1', () => {
assert.strictEqual(res._toSend.value, '101');
assert.strictEqual(res._toSend.code, undefined);
assert.strictEqual(res._status, 200);
await message.isSentRaw('This is custom update text: 101', 'bot');
await message.isSentRaw('This is custom update text: 101', '__bot__');
});

it ('with enabled POST - incorrect value', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/games/duel.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Gambling - duel - @func1', () => {
await message.isSentRaw([
'Congratulations to @user1! He is last man standing and he won 200 points (50% with bet of 100 points)!',
'Congratulations to @user2! He is last man standing and he won 200 points (50% with bet of 100 points)!',
], { userName: 'bot' });
], { userName: '__bot__' });
});
});

Expand Down
34 changes: 17 additions & 17 deletions test/tests/games/heist.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be announced', async () => {
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: 'bot' });
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: '__bot__' });
});

it('Already started bankheist should show entryInstruction with !bankheist without points', async () => {
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be finished - nobody joined', async () => {
await message.isSentRaw('Nobody joins a crew to heist.', { userName: 'bot' });
await message.isSentRaw('Nobody joins a crew to heist.', { userName: '__bot__' });
});
});

Expand Down Expand Up @@ -125,7 +125,7 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be announced', async () => {
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: 'bot' });
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: '__bot__' });
});

it('Another viewer joins with all points', async () => {
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be finished - start message', async () => {
await message.isSentRaw('Alright guys, check your equipment, this is what we trained for. This is not a game, this is real life. We will get money from Federal reserve!', { userName: 'bot' });
await message.isSentRaw('Alright guys, check your equipment, this is what we trained for. This is not a game, this is real life. We will get money from Federal reserve!', { userName: '__bot__' });
});
it('Heist should be finished - result message', async () => {
await message.isSentRaw([
Expand All @@ -190,7 +190,7 @@ describe('Heist - !bankheist - @func2', () => {
'Half of heist team was killed or catched by police.',
'Some loses of heist team is nothing of what remaining crew have in theirs pockets.',
'God divinity, nobody is dead, everyone won!',
], { userName: 'bot' });
], { userName: '__bot__' });
});
it('We need to wait at least 7 seconds', async() =>{
const steps = 7;
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be announced', async () => {
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: 'bot' });
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: '__bot__' });
});

it('Force heist to end', async () => {
Expand All @@ -242,13 +242,13 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be finished - start message', async () => {
await message.isSentRaw('Alright guys, check your equipment, this is what we trained for. This is not a game, this is real life. We will get money from Bank van!', { userName: 'bot' });
await message.isSentRaw('Alright guys, check your equipment, this is what we trained for. This is not a game, this is real life. We will get money from Bank van!', { userName: '__bot__' });
});
it('Heist should be finished - result message', async () => {
await message.isSentRaw([
'@__viewer__ was like a ninja. Nobody noticed missing money.',
'@__viewer__ failed to get rid of police and will be spending his time in jail.',
], { userName: 'bot' });
], { userName: '__bot__' });
});
});

Expand Down Expand Up @@ -286,7 +286,7 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be announced', async () => {
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: 'bot' });
await message.isSentRaw('@__viewer__ has started planning a bank heist! Looking for a bigger crew for a bigger score. Join in! Type !bankheist <points> to enter.', { userName: '__bot__' });
});
it('We need to wait at least 20 seconds', async() =>{
const steps = 10;
Expand All @@ -298,13 +298,13 @@ describe('Heist - !bankheist - @func2', () => {
});

it('Heist should be finished - start message', async () => {
await message.isSentRaw('Alright guys, check your equipment, this is what we trained for. This is not a game, this is real life. We will get money from Bank van!', { userName: 'bot' });
await message.isSentRaw('Alright guys, check your equipment, this is what we trained for. This is not a game, this is real life. We will get money from Bank van!', { userName: '__bot__' });
});
it('Heist should be finished - result message', async () => {
await message.isSentRaw([
'@__viewer__ was like a ninja. Nobody noticed missing money.',
'@__viewer__ failed to get rid of police and will be spending his time in jail.',
], { userName: 'bot' });
], { userName: '__bot__' });
});

it('User start new bankheist with !bankheist 100, but cops are patrolling', async () => {
Expand Down Expand Up @@ -340,7 +340,7 @@ describe('Heist - !bankheist - @func2', () => {
}
}).timeout(60000 * 3);
it('We should get announce that cops are not on cooldown', async () => {
await message.isSentRaw('Alright guys, looks like police forces are eating donuts and we can get that sweet money!', { userName: 'bot' });
await message.isSentRaw('Alright guys, looks like police forces are eating donuts and we can get that sweet money!', { userName: '__bot__' });
});
});

Expand Down Expand Up @@ -383,7 +383,7 @@ describe('Heist - !bankheist - @func2', () => {
it('bankVan level should be announced', async () => {
const current = 'Bank van';
const next = 'City bank';
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: 'bot' });
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: '__bot__' });
});

it(`5 users joins bankheist`, async () => {
Expand All @@ -397,7 +397,7 @@ describe('Heist - !bankheist - @func2', () => {
it('cityBank level should be announced', async () => {
const current = 'City bank';
const next = 'State bank';
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: 'bot' });
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: '__bot__' });
});

it(`10 users joins bankheist`, async () => {
Expand All @@ -411,7 +411,7 @@ describe('Heist - !bankheist - @func2', () => {
it('stateBank level should be announced', async () => {
const current = 'State bank';
const next = 'National reserve';
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: 'bot' });
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: '__bot__' });
});

it(`10 users joins bankheist`, async () => {
Expand All @@ -425,7 +425,7 @@ describe('Heist - !bankheist - @func2', () => {
it('nationalReserve level should be announced', async () => {
const current = 'National reserve';
const next = 'Federal reserve';
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: 'bot' });
await message.isSentRaw(`With this crew, we can heist ${current}! Let's see if we can get enough crew to heist ${next}`, { userName: '__bot__' });
});

it(`30 users joins bankheist`, async () => {
Expand All @@ -438,7 +438,7 @@ describe('Heist - !bankheist - @func2', () => {

it('maxLevelMessage level should be announced', async () => {
const current = 'Federal reserve';
await message.isSentRaw(`With this crew, we can heist ${current}! It cannot be any better!`, { userName: 'bot' });
await message.isSentRaw(`With this crew, we can heist ${current}! It cannot be any better!`, { userName: '__bot__' });
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ describe('Message - https://discordapp.com/channels/317348946144002050/619437014
});

it('!top time should be properly triggered', async () => {
await message.isSentRaw('Top 10 (watch time): no data available', 'bot', 20000);
await message.isSentRaw('Top 10 (watch time): no data available', '__bot__', 20000);
});
});
4 changes: 2 additions & 2 deletions test/tests/raffles/allowOverTicketing.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Raffles - allowOverTicketing - @func1', () => {

it('create ticket raffle', async () => {
raffles.open({ sender: user.owner, parameters: '!winme -min 0 -max 500' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('Update viewer to have 10 points', async () => {
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('Raffles - allowOverTicketing - @func1', () => {

it('create ticket raffle', async () => {
raffles.open({ sender: user.owner, parameters: '!winme -min 0 -max 500' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('Update viewer to have 10 points', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/raffles/bug#3546.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Raffles - raffle with 1 point cannot over point #3546 - @func2', () =>

it('create ticket raffle', async () => {
raffles.open({ sender: user.owner, parameters: '!winme -min 0 -max 500' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('Update viewer to have 1 point', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/raffles/bug#3547.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Raffles - over max limit points not adding to raffle #3547 - @func3',

it('create ticket raffle', async () => {
raffles.open({ sender: user.owner, parameters: '!winme -min 0 -max 100' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-100>". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-100>". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('Update viewer to have 1000 points', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/raffles/bug#3587.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Raffles - user will lose points when join raffle with number and all #

it('create ticket raffle', async () => {
raffles.open({ sender: user.owner, parameters: '!winme -min 0 -max 100' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-100>". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-100>". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('Update viewer and viewer2 to have 200 points', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/raffles/community#32.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('/t/raffle-owner-can-join-raffle-more-then-1-time/32 - @func2', () => {

it('create normal raffle', async () => {
raffles.open({ sender: owner, parameters: '!winme' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('loop through owner participations', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/raffles/community#38.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('/t/raffle-everyone-can-join-even-raffle-runned-for-subscribers/38 - @f

it('Create subscribers raffle', async () => {
raffles.open({ sender: owner, parameters: '!winme -for subscribers.' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme". Raffle is opened for subscribers.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme". Raffle is opened for subscribers.', { userName: '__bot__' });
});

const users = ['user1', 'user2'];
Expand Down
2 changes: 1 addition & 1 deletion test/tests/raffles/cumulativeTickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Raffles - cumulativeTickets - @func1', () => {

it('create ticket raffle', async () => {
raffles.open({ sender: user.owner, parameters: '!winme -min 0 -max 500' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: 'bot' });
await message.isSentRaw('Raffle is running (0 entries). To enter type "!winme <1-500>". Raffle is opened for everyone.', { userName: '__bot__' });
});

it('Update viewer to have 25 points', async () => {
Expand Down

0 comments on commit ce498df

Please sign in to comment.