summary refs log tree commit diff
path: root/commands/kick.ts
blob: 60568edf2ba23ecec06035b44455fd9e7a172fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { CommandFnArgs } from "../commands.ts"

export default {
    name: "kick",
    aliases: [],
    command: function ({ user, server, args }: CommandFnArgs) {
        if(!user.admin) return user.socket.send("You are not admin");
        if(!server.accounts.checkAccount(args[0])) return user.socket.send("Account not found");
        const theUser = Object.values(server.users).find(a => a.username == args[0]);
        theUser.socket.send('you were kicked')
        theUser.socket.close(1003, "Kicked");
    },
};