Added user ID requirement to notify tool to prevent mass-notifying all users.
This commit is contained in:
@@ -9,14 +9,25 @@ const { argv } = yargs(process.argv.slice(2))
|
||||
.option('scenes', {
|
||||
type: 'array',
|
||||
alias: ['scene-ids'],
|
||||
})
|
||||
.option('user-ids', {
|
||||
type: 'array',
|
||||
alias: ['users', 'user'],
|
||||
});
|
||||
|
||||
async function triggerNotify() {
|
||||
if (!argv.scenes.length) {
|
||||
if (!argv.scenes?.length) {
|
||||
throw new Error('Must specify at least one scene ID');
|
||||
}
|
||||
|
||||
await notify(argv.scenes, { spoofNew: true });
|
||||
if (!argv.userIds?.length) {
|
||||
throw new Error('Must specify at least one user ID');
|
||||
}
|
||||
|
||||
await notify(argv.scenes, {
|
||||
spoofNew: true,
|
||||
spoofUserIds: argv.userIds,
|
||||
});
|
||||
|
||||
await knex.destroy();
|
||||
await redis.quit();
|
||||
|
||||
Reference in New Issue
Block a user