1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-28 23:09:06 +09:00
MisskeyIO/cli/suspend.js
2018-04-19 18:54:34 +09:00

19 lines
361 B
JavaScript

const mongo = require('mongodb');
const User = require('../built/models/user').default;
const args = process.argv.slice(2);
const userId = new mongo.ObjectID(args[0]);
console.log(`Suspending ${userId}...`);
User.update({ _id: userId }, {
$set: {
isSuspended: true
}
}).then(() => {
console.log(`Suspended ${userId}`);
}, e => {
console.error(e);
});