@valoranchi/riot-client 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/analysis/session.d.ts +10 -0
- package/dist/analysis/session.d.ts.map +1 -0
- package/dist/analysis/session.js +209 -0
- package/dist/analysis/session.js.map +1 -0
- package/dist/cli.d.ts +6 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +71 -5
- package/dist/cli.js.map +1 -1
- package/dist/client/MatchService.d.ts +6 -1
- package/dist/client/MatchService.d.ts.map +1 -1
- package/dist/client/MatchService.js +37 -0
- package/dist/client/MatchService.js.map +1 -1
- package/dist/client/api.d.ts +6 -1
- package/dist/client/api.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/model/index.d.ts +22 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/serve/routes.d.ts.map +1 -1
- package/dist/serve/routes.js +19 -0
- package/dist/serve/routes.js.map +1 -1
- package/dist/watch/Instalock.d.ts +68 -0
- package/dist/watch/Instalock.d.ts.map +1 -0
- package/dist/watch/Instalock.js +147 -0
- package/dist/watch/Instalock.js.map +1 -0
- package/dist/watch/MatchRecap.d.ts +21 -0
- package/dist/watch/MatchRecap.d.ts.map +1 -0
- package/dist/watch/MatchRecap.js +80 -0
- package/dist/watch/MatchRecap.js.map +1 -0
- package/dist/watch/MatchWatcher.d.ts +4 -0
- package/dist/watch/MatchWatcher.d.ts.map +1 -1
- package/dist/watch/MatchWatcher.js +42 -0
- package/dist/watch/MatchWatcher.js.map +1 -1
- package/dist/watch/WebhookNotifier.d.ts +3 -2
- package/dist/watch/WebhookNotifier.d.ts.map +1 -1
- package/dist/watch/WebhookNotifier.js +28 -4
- package/dist/watch/WebhookNotifier.js.map +1 -1
- package/dist/watch/index.d.ts +2 -0
- package/dist/watch/index.d.ts.map +1 -1
- package/dist/watch/index.js +2 -0
- package/dist/watch/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/Session.json +155 -0
package/README.md
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Catalogue } from "../catalogue/Catalogue.js";
|
|
2
|
+
import type { Match, Session } from "../model/index.js";
|
|
3
|
+
import type { RiotCompetitiveUpdate } from "../riot/types.js";
|
|
4
|
+
export interface SessionSummaryOptions {
|
|
5
|
+
since?: string;
|
|
6
|
+
puuid?: string;
|
|
7
|
+
catalogue?: Catalogue;
|
|
8
|
+
}
|
|
9
|
+
export declare function sessionSummary(updates?: RiotCompetitiveUpdate[], matches?: Match[], now?: Date, options?: SessionSummaryOptions): Session;
|
|
10
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/analysis/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EACV,KAAK,EAIL,OAAO,EAER,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI9D,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAmLD,wBAAgB,cAAc,CAC5B,OAAO,GAAE,qBAAqB,EAAO,EACrC,OAAO,GAAE,KAAK,EAAO,EACrB,GAAG,GAAE,IAAiB,EACtB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAuDT"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { RankResolver } from "../collection/RankResolver.js";
|
|
2
|
+
const FOUR_HOURS_MS = 4 * 60 * 60 * 1000;
|
|
3
|
+
function resolvePlayer(match, puuid) {
|
|
4
|
+
if (puuid) {
|
|
5
|
+
const byPuuid = match.players.find((p) => p.puuid === puuid);
|
|
6
|
+
if (byPuuid)
|
|
7
|
+
return byPuuid;
|
|
8
|
+
}
|
|
9
|
+
if (match.self?.team) {
|
|
10
|
+
const byTeam = match.players.find((p) => p.team === match.self?.team);
|
|
11
|
+
if (byTeam)
|
|
12
|
+
return byTeam;
|
|
13
|
+
}
|
|
14
|
+
return match.players[0];
|
|
15
|
+
}
|
|
16
|
+
function resolveMatchResult(match, puuid) {
|
|
17
|
+
if (match.self?.won === true)
|
|
18
|
+
return "win";
|
|
19
|
+
if (match.self?.won === false)
|
|
20
|
+
return "loss";
|
|
21
|
+
const allyTeam = match.self?.team
|
|
22
|
+
? match.teams.find((t) => t.id === match.self?.team)
|
|
23
|
+
: undefined;
|
|
24
|
+
const enemyTeam = match.self?.team
|
|
25
|
+
? match.teams.find((t) => t.id !== match.self?.team)
|
|
26
|
+
: undefined;
|
|
27
|
+
if (allyTeam && enemyTeam) {
|
|
28
|
+
if (allyTeam.roundsWon > enemyTeam.roundsWon)
|
|
29
|
+
return "win";
|
|
30
|
+
if (allyTeam.roundsWon < enemyTeam.roundsWon)
|
|
31
|
+
return "loss";
|
|
32
|
+
return "draw";
|
|
33
|
+
}
|
|
34
|
+
const player = resolvePlayer(match, puuid);
|
|
35
|
+
if (player) {
|
|
36
|
+
const team = match.teams.find((t) => t.id === player.team);
|
|
37
|
+
if (team?.won)
|
|
38
|
+
return "win";
|
|
39
|
+
}
|
|
40
|
+
if (match.teams.length >= 2) {
|
|
41
|
+
const [t1, t2] = match.teams;
|
|
42
|
+
if (t1 && t2) {
|
|
43
|
+
if (t1.roundsWon > t2.roundsWon)
|
|
44
|
+
return "win";
|
|
45
|
+
if (t1.roundsWon < t2.roundsWon)
|
|
46
|
+
return "loss";
|
|
47
|
+
return "draw";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return "draw";
|
|
51
|
+
}
|
|
52
|
+
function findMatchGapStart(matches) {
|
|
53
|
+
const sorted = [...matches].sort((a, b) => new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime());
|
|
54
|
+
let lastGapStart = null;
|
|
55
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
56
|
+
const prev = sorted[i - 1];
|
|
57
|
+
const curr = sorted[i];
|
|
58
|
+
const prevEnd = new Date(prev.startedAt).getTime() + (prev.lengthMs || 0);
|
|
59
|
+
const currStart = new Date(curr.startedAt).getTime();
|
|
60
|
+
if (currStart - prevEnd >= FOUR_HOURS_MS) {
|
|
61
|
+
lastGapStart = currStart;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return lastGapStart;
|
|
65
|
+
}
|
|
66
|
+
function findUpdateGapStart(updates) {
|
|
67
|
+
const sorted = [...updates].sort((a, b) => a.MatchStartTime - b.MatchStartTime);
|
|
68
|
+
let lastGapStart = null;
|
|
69
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
70
|
+
const prev = sorted[i - 1];
|
|
71
|
+
const curr = sorted[i];
|
|
72
|
+
if (curr.MatchStartTime - prev.MatchStartTime >= FOUR_HOURS_MS) {
|
|
73
|
+
lastGapStart = curr.MatchStartTime;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return lastGapStart;
|
|
77
|
+
}
|
|
78
|
+
function resolveEffectiveSince(updates, matches, now, sinceOption) {
|
|
79
|
+
if (sinceOption) {
|
|
80
|
+
return new Date(sinceOption).getTime();
|
|
81
|
+
}
|
|
82
|
+
const today = new Date(now);
|
|
83
|
+
today.setHours(0, 0, 0, 0);
|
|
84
|
+
const todayMs = today.getTime();
|
|
85
|
+
const gapStart = findMatchGapStart(matches) ?? findUpdateGapStart(updates);
|
|
86
|
+
return gapStart !== null ? Math.max(todayMs, gapStart) : todayMs;
|
|
87
|
+
}
|
|
88
|
+
function calculateStreak(resultsReversed) {
|
|
89
|
+
if (resultsReversed.length === 0)
|
|
90
|
+
return { kind: null, length: 0 };
|
|
91
|
+
const first = resultsReversed[0];
|
|
92
|
+
if (!first || first === "draw")
|
|
93
|
+
return { kind: null, length: 0 };
|
|
94
|
+
const kind = first;
|
|
95
|
+
let length = 0;
|
|
96
|
+
for (const r of resultsReversed) {
|
|
97
|
+
if (r === kind) {
|
|
98
|
+
length++;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return { kind, length };
|
|
105
|
+
}
|
|
106
|
+
function calculateTilt(resultsChronological) {
|
|
107
|
+
const decided = resultsChronological.filter((r) => r === "win" || r === "loss");
|
|
108
|
+
if (decided.length < 3)
|
|
109
|
+
return false;
|
|
110
|
+
const last3 = decided.slice(-3);
|
|
111
|
+
return last3.every((r) => r === "loss");
|
|
112
|
+
}
|
|
113
|
+
function resolveMatchAcs(match, puuid) {
|
|
114
|
+
const player = resolvePlayer(match, puuid);
|
|
115
|
+
const stats = player?.stats;
|
|
116
|
+
const rounds = stats?.roundsPlayed && stats.roundsPlayed > 0 ? stats.roundsPlayed : 1;
|
|
117
|
+
const score = stats?.score ?? 0;
|
|
118
|
+
const acs = rounds > 0 ? Math.round(score / rounds) : score;
|
|
119
|
+
return {
|
|
120
|
+
id: match.id,
|
|
121
|
+
matchId: match.id,
|
|
122
|
+
acs,
|
|
123
|
+
map: match.map.name ?? match.map.uuid ?? null,
|
|
124
|
+
agent: player?.agent?.name ?? null,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function createFallbackRank(tier, rating) {
|
|
128
|
+
if (tier === 0) {
|
|
129
|
+
return { tier: 0, name: "Unranked", division: null, icon: null, rating };
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
tier,
|
|
133
|
+
name: `Tier ${tier}`,
|
|
134
|
+
division: null,
|
|
135
|
+
icon: null,
|
|
136
|
+
rating,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function resolveRankObject(tier, rating, resolver) {
|
|
140
|
+
return resolver ? resolver.fromTier(tier, rating) : createFallbackRank(tier, rating);
|
|
141
|
+
}
|
|
142
|
+
function resolveSessionRanks(updates, allUpdates, catalogue) {
|
|
143
|
+
const resolver = catalogue ? new RankResolver(catalogue) : undefined;
|
|
144
|
+
if (updates.length > 0) {
|
|
145
|
+
const sorted = [...updates].sort((a, b) => a.MatchStartTime - b.MatchStartTime);
|
|
146
|
+
const oldest = sorted[0];
|
|
147
|
+
const newest = sorted[sorted.length - 1];
|
|
148
|
+
return {
|
|
149
|
+
rankStart: resolveRankObject(oldest.TierBeforeUpdate, oldest.RankedRatingBeforeUpdate, resolver),
|
|
150
|
+
rankNow: resolveRankObject(newest.TierAfterUpdate, newest.RankedRatingAfterUpdate, resolver),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (allUpdates.length > 0) {
|
|
154
|
+
const sorted = [...allUpdates].sort((a, b) => a.MatchStartTime - b.MatchStartTime);
|
|
155
|
+
const latest = sorted[sorted.length - 1];
|
|
156
|
+
const rank = resolveRankObject(latest.TierAfterUpdate, latest.RankedRatingAfterUpdate, resolver);
|
|
157
|
+
return { rankStart: rank, rankNow: rank };
|
|
158
|
+
}
|
|
159
|
+
return { rankStart: null, rankNow: null };
|
|
160
|
+
}
|
|
161
|
+
export function sessionSummary(updates = [], matches = [], now = new Date(), options = {}) {
|
|
162
|
+
const effectiveSince = resolveEffectiveSince(updates, matches, now, options.since);
|
|
163
|
+
const sessionMatches = matches
|
|
164
|
+
.filter((m) => new Date(m.startedAt).getTime() >= effectiveSince)
|
|
165
|
+
.sort((a, b) => new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime());
|
|
166
|
+
const matchIds = new Set(sessionMatches.map((m) => m.id));
|
|
167
|
+
const sessionUpdates = updates.filter((u) => matchIds.has(u.MatchID) || u.MatchStartTime >= effectiveSince);
|
|
168
|
+
let wins = 0;
|
|
169
|
+
let losses = 0;
|
|
170
|
+
let draws = 0;
|
|
171
|
+
const matchResults = [];
|
|
172
|
+
for (const m of sessionMatches) {
|
|
173
|
+
const result = resolveMatchResult(m, options.puuid);
|
|
174
|
+
matchResults.push(result);
|
|
175
|
+
if (result === "win")
|
|
176
|
+
wins++;
|
|
177
|
+
else if (result === "loss")
|
|
178
|
+
losses++;
|
|
179
|
+
else
|
|
180
|
+
draws++;
|
|
181
|
+
}
|
|
182
|
+
const rrNet = sessionUpdates.reduce((sum, u) => sum + u.RankedRatingEarned, 0);
|
|
183
|
+
const totalGames = sessionMatches.length;
|
|
184
|
+
const rrPerGame = totalGames > 0 ? Math.round((rrNet / totalGames) * 10) / 10 : 0;
|
|
185
|
+
const streak = calculateStreak([...matchResults].reverse());
|
|
186
|
+
const tilt = calculateTilt(matchResults);
|
|
187
|
+
const { rankStart, rankNow } = resolveSessionRanks(sessionUpdates, updates, options.catalogue);
|
|
188
|
+
const acsEntries = sessionMatches
|
|
189
|
+
.map((m) => resolveMatchAcs(m, options.puuid))
|
|
190
|
+
.sort((a, b) => b.acs - a.acs);
|
|
191
|
+
const bestMatch = acsEntries.length > 0 ? acsEntries[0] : null;
|
|
192
|
+
const worstMatch = acsEntries.length > 0 ? acsEntries[acsEntries.length - 1] : null;
|
|
193
|
+
return {
|
|
194
|
+
since: new Date(effectiveSince).toISOString(),
|
|
195
|
+
matches: totalGames,
|
|
196
|
+
wins,
|
|
197
|
+
losses,
|
|
198
|
+
draws,
|
|
199
|
+
rrNet,
|
|
200
|
+
rrPerGame,
|
|
201
|
+
streak,
|
|
202
|
+
rankStart,
|
|
203
|
+
rankNow,
|
|
204
|
+
bestMatch,
|
|
205
|
+
worstMatch,
|
|
206
|
+
tilt,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/analysis/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAW7D,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE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;IAElF,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;IAEzC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAE/F,MAAM,UAAU,GAAG,cAAc;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;SAC7C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAEjC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAErF,OAAO;QACL,KAAK,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE;QAC7C,OAAO,EAAE,UAAU;QACnB,IAAI;QACJ,MAAM;QACN,KAAK;QACL,KAAK;QACL,SAAS;QACT,MAAM;QACN,SAAS;QACT,OAAO;QACP,SAAS;QACT,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { formatError } from "./formatError.js";
|
|
2
2
|
import { RiotClient } from "./RiotClient.js";
|
|
3
|
+
import type { InstalockOptions } from "./watch/index.js";
|
|
3
4
|
import { isSea, openBrowser, printDashboardBanner, runDashboard, shouldLaunchDashboard, startDashboardServer } from "./dashboardLauncher.js";
|
|
4
5
|
export { isSea, openBrowser, printDashboardBanner, runDashboard, shouldLaunchDashboard, startDashboardServer, };
|
|
5
|
-
export declare const USAGE = "Usage: riotclient <command> [options]\n\nAccount:\n whoami Print signed-in player profile and region\n owned-items Print owned inventory items\n collection-value Calculate estimated VP and Radianite value of owned collection\n loadout Print currently equipped loadout\n wallet Print VP, Radianite, and Kingdom Credits balances\n xp Print account level, XP progression and recent match XP history\n contracts Print progression across agent, battlepass and event contracts\n missions Print active daily and weekly missions and objectives\n penalties Print active penalties and restrictions\n favourites Print favorited weapon skins\n session Print current client session loop state and playtime\n config Print shared client configuration mapping\n client Print client identity, locale, region, and Valorant running state\n settings Print cloud player settings (--raw for unprocessed dump)\n settings-save Save player settings from JSON file (<file.json>, requires --yes --confirm)\n equip Equip skins, buddies, sprays, card, title, border, flex (dry-run, --yes to apply)\n equip-collection Equip a collection of skins (<skinUuid,...>) (dry-run, --yes to apply)\n loadout-export Export current loadout as a preset JSON\n loadout-diff Compare current loadout against preset JSON file (<preset.json>)\n loadout-apply Apply loadout preset from JSON file (<preset.json>, dry-run, --yes to apply)\n contract-activate Activate an agent contract (<uuid>) (dry-run, --yes to apply)\n favourite-add Add skin to favourites (<skin>) (dry-run, --yes to apply)\n favourite-remove Remove skin from favourites (<skin>) (dry-run, --yes to apply)\n privacy Update account privacy toggles (--badge on|off, --leaderboard on|off)\n\nSocial:\n friends Print friends roster and presence\n friend-requests Print incoming and outgoing friend requests\n blocked Print blocked players\n conversations Print whisper and match chat conversations\n messages Print chat messages (filter with --cid <id>)\n participants Print chat participants (filter with --cid <id>)\n send Send chat message (--to <puuid|name#tag|cid> --text <msg>)\n friend-request Send friend request (<name#tag>)\n friend-accept Accept friend request (<puuid>)\n friend-decline Decline friend request (<puuid>)\n friend-cancel Cancel friend request (<puuid>)\n friend-remove Remove friend (<puuid>)\n block Block player (<puuid|name#tag>)\n unblock Unblock player (<puuid>)\n\nStore:\n store Print storefront (daily, night market, bundles, accessories)\n store-history Print recorded daily store rotations [--days <n>]\n store-seen Print when a skin was last seen in daily store (<skin>)\n offers Print full item offers catalog and pricing\n order <id> Print store order details\n night-market-reveal Reveal night market offers (dry-run, --yes to apply)\n buy Purchase offer or bundle (--offer <id> | --bundle <id>, requires --yes --confirm)\n wishlist Print skin wishlist or manage items (add <skin>, remove <skin>, check)\n\nMatches:\n matches Print recent match history summaries\n matches-sync Synchronize match history to local cache [--pages <n>]\n match <id> Print full match details by ID\n mmr Print current rank, rating, and MMR breakdown\n rank-history Print competitive rating adjustments and tier changes\n live Print live pregame or in-game lobby status and loadouts\n matches-for <puuid> Print recent match history summaries for player\n mmr-for <puuid> Print rank, rating, and MMR for player\n rank-history-for <puuid> Print competitive updates for player\n leaderboard Print competitive leaderboard [--season] [--start] [--size] [--query]\n content Print active act, episode and live events\n premier Print premier eligibility, roster, and season info\n trend Print competitive rating streak, net RR gains, and climbing pace\n summary Print player performance summary across recent matches [--count n] [--queue q]\n assess [puuid] Assess player rank anomalies, streaks, and warning flags\n agent-select Select an agent in pregame (<uuid|name>) (dry-run, --yes to apply)\n agent-lock Lock in an agent in pregame (<uuid|name>) (dry-run, --yes to apply)\n dodge Dodge pregame agent select (requires --yes --confirm)\n leave-match Leave active in-game match (requires --yes --confirm)\n\nParty:\n party Print current party details and members\n queues Print matchmaking queue configurations\n custom-game-configs Print custom game configuration options\n party-invite Invite player to party (<name#tag>)\n party-kick Kick member from party (<puuid>)\n party-promote Promote member to party owner (<puuid>)\n party-code Generate or revoke party invite code [--revoke]\n party-join Join party by invite code or party ID (<partyId|code>)\n party-invites Print incoming party invites\n party-requests Print incoming party join requests\n party-decline-invite Decline party invite (<id>) (dry-run, --yes to apply)\n party-request Request to join party (<partyId>) (dry-run, --yes to apply)\n party-decline-request Decline party join request (<id>) (dry-run, --yes to apply)\n custom-game Convert party into a custom game (dry-run, --yes to apply)\n custom-game-settings Configure custom game (--map <name> --mode <name> [--server <id>] [--rule k=v...])\n custom-game-team Set member custom game team (<puuid> <team>) (dry-run, --yes to apply)\n custom-game-start Start custom game match (dry-run, --yes to apply)\n custom-game-balance Balance custom game teams (dry-run, --yes to apply)\n party-default Set party default queue (<queue>) (dry-run, --yes to apply)\n party-servers Set preferred game servers (<id,...>) (dry-run, --yes to apply)\n party-moderator Set member moderator status (<puuid> on|off) (dry-run, --yes to apply)\n party-refresh Refresh party member pings and identity (dry-run, --yes to apply)\n party-ready Set party ready state (on|off)\n party-queue Change party queue (<queue>)\n party-access Set party accessibility (open|closed)\n party-start Start party matchmaking\n party-stop Stop party matchmaking\n party-leave Leave current party\n\nRaw (unsupported):\n local Send raw request to local Riot client API (<get|post|put|delete> <path> [--body json])\n riot Send raw request to remote Riot game servers (<get|post|put|delete> <url> [--body json])\n\nEvents:\n watch Stream real-time events as JSON lines until interrupted\n watch store Stream store wishlist rotation hits until interrupted [--webhook <url>] [--interval <min>]\n watch-match Stream match lifecycle events until interrupted\n watch-friends Stream friend activity and presence events until interrupted\n\nServer:\n dashboard Start local server and open interactive web dashboard\n serve Start local HTTP server with SSE events and OpenAPI docs [--port 47800] [--host 127.0.0.1] [--allow-remote]\n mcp Start Model Context Protocol (MCP) server over stdio for AI assistants\n\nOfficial:\n official account <name#tag> Print player PUUID and active shard\n official matches <name#tag> Print player match history [--queue <q>] [--count <n>]\n official match <id> Print full match details (--shard <shard> [--self <puuid>])\n official leaderboard Print competitive leaderboard (--shard <shard> [--act <id>] [--start <n>] [--size <n>])\n official status Print platform status and maintenance alerts (--shard <shard>)\n official summary <name#tag> Print player performance summary [--queue <q>] [--count <n>]\n official profile <name#tag> Print player scouting profile [--count <n>]\n\nOptions:\n --yes Execute write command (default is dry-run)\n --confirm Confirm write action (required with buy, dodge, leave-match, settings-save)\n --offer <id> Store offer ID to purchase\n --bundle <id> Store bundle ID to purchase\n --badge <on|off> Hide or show act rank badge\n --leaderboard <on|off> Anonymize or reveal leaderboard presence\n --season <uuid> Season ID for leaderboard\n --start <n> Leaderboard starting index\n --size <n> Leaderboard page size (max 510)\n --query <text> Leaderboard player search query\n --revoke Revoke party invite code (used with party-code)\n --to <target> Message recipient (puuid, name#tag, or cid)\n --text <msg> Message text\n --gun <spec> Gun to equip: <weapon>=<skin>[:level[:chroma]] (repeatable)\n --buddy <spec> Buddy to equip: <weapon>=<buddy|none> (repeatable)\n --spray <spec> Spray to equip: <slot>=<uuid|none> (repeatable)\n --card <uuid> Player card UUID\n --title <uuid> Player title UUID\n --flex <uuid|none> Flex item UUID or none\n --border <uuid> Level border UUID\n --incognito <on|off> Enable or disable incognito\n --hide-level <on|off> Hide or show account level\n --count <n> Number of matches or rank history entries to fetch\n --queue <queue> Queue filter (e.g. competitive, unrated)\n --ranks Fetch MMR and rank for each player in live match\n --no-loadouts Skip fetching player loadouts in live match\n --map <name> Map name or path for custom game\n --mode <name> Game mode name or path for custom game\n --server <id> Server pod ID for custom game\n --rule <spec> Game rule override: <name>=<value> (repeatable)\n --body <json> JSON request body for local and riot raw commands\n --only <events> Comma-separated list of event names to print\n --raw Include raw client event frames or unformatted settings\n --cid <id> Conversation ID for filtering messages or participants\n --api-key <key> Riot Developer API key (or RIOT_API_KEY env)\n --shard <shard> Riot shard (na, latam, br, eu, ap, kr)\n --self <puuid> Player PUUID for self perspective in official match\n --act <uuid> Act or season UUID for official leaderboard\n --language <lang> Catalogue language (default: en-US)\n --cache <seconds> Reuse Riot responses younger than this many seconds\n --no-official-cache Disable official match disk cache\n --webhook <url> Webhook URL for store alerts (Discord or generic)\n --interval <min> Check interval in minutes for store watcher\n --port <n> Port to bind HTTP server (default: 47800)\n --host <ip> Host address to bind HTTP server (default: 127.0.0.1)\n --allow-remote Allow binding HTTP server to non-loopback address\n --pretty Pretty-print JSON output\n --help Show usage instructions\n --version Show version number\n";
|
|
6
|
+
export declare const USAGE = "Usage: riotclient <command> [options]\n\nAccount:\n whoami Print signed-in player profile and region\n owned-items Print owned inventory items\n collection-value Calculate estimated VP and Radianite value of owned collection\n loadout Print currently equipped loadout\n wallet Print VP, Radianite, and Kingdom Credits balances\n xp Print account level, XP progression and recent match XP history\n contracts Print progression across agent, battlepass and event contracts\n missions Print active daily and weekly missions and objectives\n penalties Print active penalties and restrictions\n favourites Print favorited weapon skins\n session Print current client session loop state and playtime\n config Print shared client configuration mapping\n client Print client identity, locale, region, and Valorant running state\n settings Print cloud player settings (--raw for unprocessed dump)\n settings-save Save player settings from JSON file (<file.json>, requires --yes --confirm)\n equip Equip skins, buddies, sprays, card, title, border, flex (dry-run, --yes to apply)\n equip-collection Equip a collection of skins (<skinUuid,...>) (dry-run, --yes to apply)\n loadout-export Export current loadout as a preset JSON\n loadout-diff Compare current loadout against preset JSON file (<preset.json>)\n loadout-apply Apply loadout preset from JSON file (<preset.json>, dry-run, --yes to apply)\n contract-activate Activate an agent contract (<uuid>) (dry-run, --yes to apply)\n favourite-add Add skin to favourites (<skin>) (dry-run, --yes to apply)\n favourite-remove Remove skin from favourites (<skin>) (dry-run, --yes to apply)\n privacy Update account privacy toggles (--badge on|off, --leaderboard on|off)\n\nSocial:\n friends Print friends roster and presence\n friend-requests Print incoming and outgoing friend requests\n blocked Print blocked players\n conversations Print whisper and match chat conversations\n messages Print chat messages (filter with --cid <id>)\n participants Print chat participants (filter with --cid <id>)\n send Send chat message (--to <puuid|name#tag|cid> --text <msg>)\n friend-request Send friend request (<name#tag>)\n friend-accept Accept friend request (<puuid>)\n friend-decline Decline friend request (<puuid>)\n friend-cancel Cancel friend request (<puuid>)\n friend-remove Remove friend (<puuid>)\n block Block player (<puuid|name#tag>)\n unblock Unblock player (<puuid>)\n\nStore:\n store Print storefront (daily, night market, bundles, accessories)\n store-history Print recorded daily store rotations [--days <n>]\n store-seen Print when a skin was last seen in daily store (<skin>)\n offers Print full item offers catalog and pricing\n order <id> Print store order details\n night-market-reveal Reveal night market offers (dry-run, --yes to apply)\n buy Purchase offer or bundle (--offer <id> | --bundle <id>, requires --yes --confirm)\n wishlist Print skin wishlist or manage items (add <skin>, remove <skin>, check)\n\nMatches:\n matches Print recent match history summaries\n matches-sync Synchronize match history to local cache [--pages <n>]\n match <id> Print full match details by ID\n mmr Print current rank, rating, and MMR breakdown\n rank-history Print competitive rating adjustments and tier changes\n live Print live pregame or in-game lobby status and loadouts\n matches-for <puuid> Print recent match history summaries for player\n mmr-for <puuid> Print rank, rating, and MMR for player\n rank-history-for <puuid> Print competitive updates for player\n leaderboard Print competitive leaderboard [--season] [--start] [--size] [--query]\n content Print active act, episode and live events\n premier Print premier eligibility, roster, and season info\n trend Print competitive rating streak, net RR gains, and climbing pace\n summary Print player performance summary across recent matches [--count n] [--queue q]\n play-session Print today's play session summary [--since <iso>]\n instalock <agent> Auto-lock an agent in pregame [--on-map Map=Agent...] [--fallback a...] [--delay n] [--select] [--once] [--yes]\n assess [puuid] Assess player rank anomalies, streaks, and warning flags\n agent-select Select an agent in pregame (<uuid|name>) (dry-run, --yes to apply)\n agent-lock Lock in an agent in pregame (<uuid|name>) (dry-run, --yes to apply)\n dodge Dodge pregame agent select (requires --yes --confirm)\n leave-match Leave active in-game match (requires --yes --confirm)\n\nParty:\n party Print current party details and members\n queues Print matchmaking queue configurations\n custom-game-configs Print custom game configuration options\n party-invite Invite player to party (<name#tag>)\n party-kick Kick member from party (<puuid>)\n party-promote Promote member to party owner (<puuid>)\n party-code Generate or revoke party invite code [--revoke]\n party-join Join party by invite code or party ID (<partyId|code>)\n party-invites Print incoming party invites\n party-requests Print incoming party join requests\n party-decline-invite Decline party invite (<id>) (dry-run, --yes to apply)\n party-request Request to join party (<partyId>) (dry-run, --yes to apply)\n party-decline-request Decline party join request (<id>) (dry-run, --yes to apply)\n custom-game Convert party into a custom game (dry-run, --yes to apply)\n custom-game-settings Configure custom game (--map <name> --mode <name> [--server <id>] [--rule k=v...])\n custom-game-team Set member custom game team (<puuid> <team>) (dry-run, --yes to apply)\n custom-game-start Start custom game match (dry-run, --yes to apply)\n custom-game-balance Balance custom game teams (dry-run, --yes to apply)\n party-default Set party default queue (<queue>) (dry-run, --yes to apply)\n party-servers Set preferred game servers (<id,...>) (dry-run, --yes to apply)\n party-moderator Set member moderator status (<puuid> on|off) (dry-run, --yes to apply)\n party-refresh Refresh party member pings and identity (dry-run, --yes to apply)\n party-ready Set party ready state (on|off)\n party-queue Change party queue (<queue>)\n party-access Set party accessibility (open|closed)\n party-start Start party matchmaking\n party-stop Stop party matchmaking\n party-leave Leave current party\n\nRaw (unsupported):\n local Send raw request to local Riot client API (<get|post|put|delete> <path> [--body json])\n riot Send raw request to remote Riot game servers (<get|post|put|delete> <url> [--body json])\n\nEvents:\n watch Stream real-time events as JSON lines until interrupted\n watch store Stream store wishlist rotation hits until interrupted [--webhook <url>] [--interval <min>]\n watch match Stream match lifecycle events until interrupted [--webhook <url>]\n watch-match Stream match lifecycle events until interrupted [--webhook <url>]\n watch-friends Stream friend activity and presence events until interrupted\n\nServer:\n dashboard Start local server and open interactive web dashboard\n serve Start local HTTP server with SSE events and OpenAPI docs [--port 47800] [--host 127.0.0.1] [--allow-remote]\n mcp Start Model Context Protocol (MCP) server over stdio for AI assistants\n\nOfficial:\n official account <name#tag> Print player PUUID and active shard\n official matches <name#tag> Print player match history [--queue <q>] [--count <n>]\n official match <id> Print full match details (--shard <shard> [--self <puuid>])\n official leaderboard Print competitive leaderboard (--shard <shard> [--act <id>] [--start <n>] [--size <n>])\n official status Print platform status and maintenance alerts (--shard <shard>)\n official summary <name#tag> Print player performance summary [--queue <q>] [--count <n>]\n official profile <name#tag> Print player scouting profile [--count <n>]\n\nOptions:\n --yes Execute write command (default is dry-run)\n --confirm Confirm write action (required with buy, dodge, leave-match, settings-save)\n --offer <id> Store offer ID to purchase\n --bundle <id> Store bundle ID to purchase\n --badge <on|off> Hide or show act rank badge\n --leaderboard <on|off> Anonymize or reveal leaderboard presence\n --season <uuid> Season ID for leaderboard\n --start <n> Leaderboard starting index\n --size <n> Leaderboard page size (max 510)\n --query <text> Leaderboard player search query\n --revoke Revoke party invite code (used with party-code)\n --to <target> Message recipient (puuid, name#tag, or cid)\n --text <msg> Message text\n --gun <spec> Gun to equip: <weapon>=<skin>[:level[:chroma]] (repeatable)\n --buddy <spec> Buddy to equip: <weapon>=<buddy|none> (repeatable)\n --spray <spec> Spray to equip: <slot>=<uuid|none> (repeatable)\n --card <uuid> Player card UUID\n --title <uuid> Player title UUID\n --flex <uuid|none> Flex item UUID or none\n --border <uuid> Level border UUID\n --incognito <on|off> Enable or disable incognito\n --hide-level <on|off> Hide or show account level\n --count <n> Number of matches or rank history entries to fetch\n --queue <queue> Queue filter (e.g. competitive, unrated)\n --ranks Fetch MMR and rank for each player in live match\n --no-loadouts Skip fetching player loadouts in live match\n --map <name> Map name or path for custom game\n --mode <name> Game mode name or path for custom game\n --server <id> Server pod ID for custom game\n --rule <spec> Game rule override: <name>=<value> (repeatable)\n --body <json> JSON request body for local and riot raw commands\n --only <events> Comma-separated list of event names to print\n --raw Include raw client event frames or unformatted settings\n --cid <id> Conversation ID for filtering messages or participants\n --api-key <key> Riot Developer API key (or RIOT_API_KEY env)\n --shard <shard> Riot shard (na, latam, br, eu, ap, kr)\n --self <puuid> Player PUUID for self perspective in official match\n --act <uuid> Act or season UUID for official leaderboard\n --language <lang> Catalogue language (default: en-US)\n --cache <seconds> Reuse Riot responses younger than this many seconds\n --no-official-cache Disable official match disk cache\n --webhook <url> Webhook URL for store or match alerts (Discord or generic)\n --interval <min> Check interval in minutes for store watcher\n --since <iso> ISO timestamp cutoff for play session\n --on-map <m=a> Agent for a map in instalock, e.g. Haven=Omen (repeatable)\n --fallback <agent> Fallback agent for instalock (repeatable)\n --delay <ms> Delay before selecting/locking in milliseconds (0-10000)\n --select Select agent without locking in instalock\n --once Stop instalock after first match\n --port <n> Port to bind HTTP server (default: 47800)\n --host <ip> Host address to bind HTTP server (default: 127.0.0.1)\n --allow-remote Allow binding HTTP server to non-loopback address\n --pretty Pretty-print JSON output\n --help Show usage instructions\n --version Show version number\n";
|
|
6
7
|
export declare function exitCodeForError(error: unknown): number;
|
|
7
8
|
export { formatError };
|
|
8
9
|
export declare function formatWatchLine(event: string, data: unknown, at?: string): string;
|
|
@@ -10,7 +11,10 @@ export declare function runWatch(client: RiotClient, options?: {
|
|
|
10
11
|
only?: string;
|
|
11
12
|
raw?: boolean;
|
|
12
13
|
}): Promise<number>;
|
|
13
|
-
export declare function runWatchMatch(client: RiotClient
|
|
14
|
+
export declare function runWatchMatch(client: RiotClient, options?: {
|
|
15
|
+
webhook?: string;
|
|
16
|
+
}): Promise<number>;
|
|
17
|
+
export declare function runInstalock(client: RiotClient, options: InstalockOptions): Promise<number>;
|
|
14
18
|
export declare function runWatchFriends(client: RiotClient): Promise<number>;
|
|
15
19
|
export declare function runWatchStore(client: RiotClient, options?: {
|
|
16
20
|
webhook?: string;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAA6C,MAAM,iBAAiB,CAAC;AACxF,OAAO,EACL,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,GACrB,CAAC;AAEF,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAA6C,MAAM,iBAAiB,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,KAAK,EACL,WAAW,EACX,oBA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AAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACpE,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED,wBAAsB,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBhE;AA05BD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsL5D"}
|
package/dist/cli.js
CHANGED
|
@@ -76,6 +76,8 @@ Matches:
|
|
|
76
76
|
premier Print premier eligibility, roster, and season info
|
|
77
77
|
trend Print competitive rating streak, net RR gains, and climbing pace
|
|
78
78
|
summary Print player performance summary across recent matches [--count n] [--queue q]
|
|
79
|
+
play-session Print today's play session summary [--since <iso>]
|
|
80
|
+
instalock <agent> Auto-lock an agent in pregame [--on-map Map=Agent...] [--fallback a...] [--delay n] [--select] [--once] [--yes]
|
|
79
81
|
assess [puuid] Assess player rank anomalies, streaks, and warning flags
|
|
80
82
|
agent-select Select an agent in pregame (<uuid|name>) (dry-run, --yes to apply)
|
|
81
83
|
agent-lock Lock in an agent in pregame (<uuid|name>) (dry-run, --yes to apply)
|
|
@@ -119,7 +121,8 @@ Raw (unsupported):
|
|
|
119
121
|
Events:
|
|
120
122
|
watch Stream real-time events as JSON lines until interrupted
|
|
121
123
|
watch store Stream store wishlist rotation hits until interrupted [--webhook <url>] [--interval <min>]
|
|
122
|
-
watch
|
|
124
|
+
watch match Stream match lifecycle events until interrupted [--webhook <url>]
|
|
125
|
+
watch-match Stream match lifecycle events until interrupted [--webhook <url>]
|
|
123
126
|
watch-friends Stream friend activity and presence events until interrupted
|
|
124
127
|
|
|
125
128
|
Server:
|
|
@@ -178,8 +181,14 @@ Options:
|
|
|
178
181
|
--language <lang> Catalogue language (default: en-US)
|
|
179
182
|
--cache <seconds> Reuse Riot responses younger than this many seconds
|
|
180
183
|
--no-official-cache Disable official match disk cache
|
|
181
|
-
--webhook <url> Webhook URL for store alerts (Discord or generic)
|
|
184
|
+
--webhook <url> Webhook URL for store or match alerts (Discord or generic)
|
|
182
185
|
--interval <min> Check interval in minutes for store watcher
|
|
186
|
+
--since <iso> ISO timestamp cutoff for play session
|
|
187
|
+
--on-map <m=a> Agent for a map in instalock, e.g. Haven=Omen (repeatable)
|
|
188
|
+
--fallback <agent> Fallback agent for instalock (repeatable)
|
|
189
|
+
--delay <ms> Delay before selecting/locking in milliseconds (0-10000)
|
|
190
|
+
--select Select agent without locking in instalock
|
|
191
|
+
--once Stop instalock after first match
|
|
183
192
|
--port <n> Port to bind HTTP server (default: 47800)
|
|
184
193
|
--host <ip> Host address to bind HTTP server (default: 127.0.0.1)
|
|
185
194
|
--allow-remote Allow binding HTTP server to non-loopback address
|
|
@@ -257,8 +266,8 @@ export async function runWatch(client, options = {}) {
|
|
|
257
266
|
await client.close();
|
|
258
267
|
return 0;
|
|
259
268
|
}
|
|
260
|
-
export async function runWatchMatch(client) {
|
|
261
|
-
const watcher = client.watch.match();
|
|
269
|
+
export async function runWatchMatch(client, options = {}) {
|
|
270
|
+
const watcher = client.watch.match({ webhook: options.webhook });
|
|
262
271
|
const onSignal = () => {
|
|
263
272
|
process.off("SIGINT", onSignal);
|
|
264
273
|
process.off("SIGTERM", onSignal);
|
|
@@ -279,6 +288,47 @@ export async function runWatchMatch(client) {
|
|
|
279
288
|
}
|
|
280
289
|
return 0;
|
|
281
290
|
}
|
|
291
|
+
function instalockOptions(positionals, values) {
|
|
292
|
+
const agent = requirePositional(positionals, 1, "Usage: instalock <agent>");
|
|
293
|
+
const byMap = Object.fromEntries((values["on-map"] ?? []).map((entry) => {
|
|
294
|
+
const [map, mapAgent] = entry.split("=");
|
|
295
|
+
if (!map || !mapAgent) {
|
|
296
|
+
throw new ValidationError("invalid-argument", `--on-map expects Map=Agent, got "${entry}"`);
|
|
297
|
+
}
|
|
298
|
+
return [map.trim(), mapAgent.trim()];
|
|
299
|
+
}));
|
|
300
|
+
return {
|
|
301
|
+
agent,
|
|
302
|
+
byMap,
|
|
303
|
+
fallbacks: values.fallback ?? [],
|
|
304
|
+
delayMs: values.delay ? Number(values.delay) : undefined,
|
|
305
|
+
select: Boolean(values.select),
|
|
306
|
+
once: Boolean(values.once),
|
|
307
|
+
dryRun: !values.yes,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export async function runInstalock(client, options) {
|
|
311
|
+
const handle = client.matches.instalock(options);
|
|
312
|
+
const onSignal = () => {
|
|
313
|
+
process.off("SIGINT", onSignal);
|
|
314
|
+
process.off("SIGTERM", onSignal);
|
|
315
|
+
handle.stop();
|
|
316
|
+
};
|
|
317
|
+
process.on("SIGINT", onSignal);
|
|
318
|
+
process.on("SIGTERM", onSignal);
|
|
319
|
+
try {
|
|
320
|
+
for await (const item of handle) {
|
|
321
|
+
process.stdout.write(`${JSON.stringify(item)}\n`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
finally {
|
|
325
|
+
process.off("SIGINT", onSignal);
|
|
326
|
+
process.off("SIGTERM", onSignal);
|
|
327
|
+
handle.stop();
|
|
328
|
+
await client.close();
|
|
329
|
+
}
|
|
330
|
+
return 0;
|
|
331
|
+
}
|
|
282
332
|
export async function runWatchFriends(client) {
|
|
283
333
|
const watcher = client.watch.friends();
|
|
284
334
|
const onSignal = () => {
|
|
@@ -487,6 +537,10 @@ async function executeStandardCommand(client, command, options) {
|
|
|
487
537
|
return client.account.favourites();
|
|
488
538
|
case "session":
|
|
489
539
|
return client.account.session();
|
|
540
|
+
case "play-session":
|
|
541
|
+
return client.matches.session({
|
|
542
|
+
since: typeof options?.rawValues?.since === "string" ? options.rawValues.since : undefined,
|
|
543
|
+
});
|
|
490
544
|
case "config":
|
|
491
545
|
return client.account.config();
|
|
492
546
|
case "friends":
|
|
@@ -1160,6 +1214,12 @@ export async function runCli(args) {
|
|
|
1160
1214
|
"no-official-cache": { type: "boolean", default: false },
|
|
1161
1215
|
webhook: { type: "string" },
|
|
1162
1216
|
interval: { type: "string" },
|
|
1217
|
+
since: { type: "string" },
|
|
1218
|
+
"on-map": { type: "string", multiple: true },
|
|
1219
|
+
fallback: { type: "string", multiple: true },
|
|
1220
|
+
delay: { type: "string" },
|
|
1221
|
+
select: { type: "boolean", default: false },
|
|
1222
|
+
once: { type: "boolean", default: false },
|
|
1163
1223
|
},
|
|
1164
1224
|
allowPositionals: true,
|
|
1165
1225
|
});
|
|
@@ -1185,6 +1245,9 @@ export async function runCli(args) {
|
|
|
1185
1245
|
});
|
|
1186
1246
|
try {
|
|
1187
1247
|
if (command === "watch") {
|
|
1248
|
+
if (parsed.positionals[1] === "match") {
|
|
1249
|
+
return await runWatchMatch(client, { webhook: parsed.values.webhook });
|
|
1250
|
+
}
|
|
1188
1251
|
if (parsed.positionals[1] === "store") {
|
|
1189
1252
|
const intervalMinutes = parsed.values.interval ? Number(parsed.values.interval) : undefined;
|
|
1190
1253
|
const webhook = parsed.values.webhook ? String(parsed.values.webhook) : undefined;
|
|
@@ -1201,7 +1264,10 @@ export async function runCli(args) {
|
|
|
1201
1264
|
return await runWatchStore(client, { webhook, intervalMinutes });
|
|
1202
1265
|
}
|
|
1203
1266
|
if (command === "watch-match") {
|
|
1204
|
-
return await runWatchMatch(client);
|
|
1267
|
+
return await runWatchMatch(client, { webhook: parsed.values.webhook });
|
|
1268
|
+
}
|
|
1269
|
+
if (command === "instalock") {
|
|
1270
|
+
return await runInstalock(client, instalockOptions(parsed.positionals, parsed.values));
|
|
1205
1271
|
}
|
|
1206
1272
|
if (command === "watch-friends") {
|
|
1207
1273
|
return await runWatchFriends(client);
|