mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
✌️
This commit is contained in:
parent
7ead811016
commit
5b798ed0c2
@ -3,16 +3,21 @@ const User = require('../built/models/user').default;
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
const userId = new mongo.ObjectID(args[0]);
|
||||
const user = args[0];
|
||||
|
||||
console.log(`Suspending ${userId}...`);
|
||||
const q = user.startsWith('@') ? {
|
||||
username: user.split('@')[1],
|
||||
host: user.split('@')[2]
|
||||
} : { _id: new mongo.ObjectID(user) };
|
||||
|
||||
User.update({ _id: userId }, {
|
||||
console.log(`Suspending ${user}...`);
|
||||
|
||||
User.update(q, {
|
||||
$set: {
|
||||
isSuspended: true
|
||||
}
|
||||
}).then(() => {
|
||||
console.log(`Suspended ${userId}`);
|
||||
console.log(`Suspended ${user}`);
|
||||
}, e => {
|
||||
console.error(e);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user