(argv: ArgumentsCamelCase<CommandArgs>)
| 45 | .epilog(buildEpilog({ command, apiDocs: 'createChannel' })) |
| 46 | |
| 47 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 48 | const command = await apiOrganizationCommand(argv) |
| 49 | |
| 50 | const getInputFromUser = async (): Promise<ChannelCreate> => { |
| 51 | const name = await stringInput('Channel name:') |
| 52 | const description = await stringInput('Channel description:') |
| 53 | const termsOfServiceUrl = await stringInput('Channel terms of service URL:', { validate: urlValidate }) |
| 54 | |
| 55 | return { name, description, termsOfServiceUrl, type: 'DRIVER' } |
| 56 | } |
| 57 | |
| 58 | await inputAndOutputItem<ChannelCreate, Channel>( |
| 59 | command, |
| 60 | { tableFieldDefinitions }, |
| 61 | (_, input: ChannelCreate) => command.client.channels.create(input), |
| 62 | userInputProcessor(() => getInputFromUser()), |
| 63 | ) |
| 64 | } |
| 65 | |
| 66 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 67 | export default cmd |
nothing calls this directly
no test coverage detected