Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quite a major update #30

Merged
merged 33 commits into from
Jul 18, 2020
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f87dd96
Bump lodash from 4.17.15 to 4.17.19
dependabot[bot] Jul 16, 2020
99c293b
Merge pull request #29 from idinium96/dependabot/npm_and_yarn/lodash-…
idinium96 Jul 16, 2020
b1f05a5
update note
idinium96 Jul 16, 2020
4ac0c7f
add a parameter %amount_can_buy% for listing note
idinium96 Jul 16, 2020
89821d3
Merge branch 'development' of https://github.com/idinium96/tf2autobot…
idinium96 Jul 16, 2020
dfa03ab
add an option to customize playing game name
idinium96 Jul 17, 2020
ede73bd
5x Uses for Dueling Mini-Game is now an option
idinium96 Jul 17, 2020
82a46e9
add an option for 25 uses Noise Maker check
idinium96 Jul 17, 2020
23c1300
ouch. I need more glasses.
idinium96 Jul 17, 2020
be84a06
revert - it's actually already correct. -.-'
idinium96 Jul 17, 2020
ce45404
update README
idinium96 Jul 17, 2020
48c1e16
for feature experiment - old crateseries # problem
idinium96 Jul 18, 2020
ce434e9
add !craftweapon and !uncraftweapon commands
idinium96 Jul 18, 2020
1ab4bb9
delete an item with an item assetid or sku
idinium96 Jul 18, 2020
0735688
option to accept INVALID_ITEMS/OVERSTOCKED overpay
idinium96 Jul 18, 2020
f9c2461
fix crashed - but mostly can't delete by assetid
idinium96 Jul 18, 2020
4272596
can have both sku and assetid parameters
idinium96 Jul 18, 2020
0a41762
only delete if sku & assetid entered match.
idinium96 Jul 18, 2020
e192e06
option to just decline INVALID_VALUE trades
idinium96 Jul 18, 2020
b87850c
add option to automatically decline INVALID_VALUE
idinium96 Jul 18, 2020
dfd625a
change the newly added variables name
idinium96 Jul 18, 2020
1a4da92
update a variable name
idinium96 Jul 18, 2020
dd73aa1
add a missing invalid_value exception condition
idinium96 Jul 18, 2020
069da3e
fix wrong position
idinium96 Jul 18, 2020
c549b66
fix not matched with README
idinium96 Jul 18, 2020
b944df5
add ecosystem.json templates for multiple bots
idinium96 Jul 18, 2020
1f1fa02
update README
idinium96 Jul 18, 2020
7f72efd
update README
idinium96 Jul 18, 2020
811d6de
redo
idinium96 Jul 18, 2020
ed495ff
redo README
idinium96 Jul 18, 2020
06ac14e
apply some improvements
idinium96 Jul 18, 2020
0ae8228
update dependencies
idinium96 Jul 18, 2020
076ba98
do CI build check for node v14.x
idinium96 Jul 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
can have both sku and assetid parameters
  • Loading branch information
idinium96 committed Jul 18, 2020
commit 4272596e809d130d788c93fb910f00e8333e696c
29 changes: 25 additions & 4 deletions src/classes/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ export = class Commands {
private deleteCommand(steamID: SteamID, message: string): void {
const params = CommandParser.parseParams(CommandParser.removeCommand(message));

if (params.assetid !== undefined) {
if (params.assetid !== undefined && params.sku === undefined) {
const ourInventory = this.bot.inventoryManager.getInventory();
const sku = ourInventory.findByAssetid(params.assetid);

Expand Down Expand Up @@ -1704,14 +1704,35 @@ export = class Commands {
return;
}

this.bot.tf2gc.deleteItem(assetids[0], err => {
let assetid: string;
if (params.assetid !== undefined && assetids.includes(params.assetid)) {
assetid = params.assetid;
} else {
assetid = assetids[0];
}

this.bot.tf2gc.deleteItem(assetid, err => {
if (err) {
log.warn(`Error trying to delete ${name}: `, err);
this.bot.sendMessage(steamID, `❌ Failed to delete ${name}(${assetids[0]}): ${err.message}`);
this.bot.sendMessage(
steamID,
`❌ Failed to delete ${name}(${
assetid === params.assetid
? assetid
: `assetid ${params.assetid} didn't matched, used a random assetid ${assetids[0]}`
}): ${err.message}`
);
return;
}

this.bot.sendMessage(steamID, `✅ Deleted ${name}(${assetids[0]})!`);
this.bot.sendMessage(
steamID,
`✅ Deleted ${name}(${
assetid === params.assetid
? assetid
: `assetid ${params.assetid} didn't matched, used a random assetid ${assetids[0]}`
})!`
);
});
}

Expand Down