summary refs log tree commit diff
path: root/commands/kick.ts
diff options
context:
space:
mode:
Diffstat (limited to 'commands/kick.ts')
-rw-r--r--commands/kick.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/commands/kick.ts b/commands/kick.ts
new file mode 100644
index 0000000..60568ed
--- /dev/null
+++ b/commands/kick.ts
@@ -0,0 +1,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");
+    },
+};