RocketChat/Rocket.Chat

View on GitHub
apps/meteor/app/slashcommands-kick/client/client.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { SlashCommandCallbackParams } from '@rocket.chat/core-typings';

import { slashCommands } from '../../utils/client/slashCommand';

slashCommands.add({
    command: 'kick',
    callback({ params }: SlashCommandCallbackParams<'kick'>) {
        const username = params.trim();
        if (username === '') {
            return;
        }
        return username.replace('@', '');
    },
    options: {
        description: 'Remove_someone_from_room',
        params: '@username',
        permission: 'remove-user',
    },
});