GetStream / stream-cli

Configure & manage Stream applications from the command line. 🚀
https://yarnpkg.com/en/package/getstream-cli
BSD 3-Clause "New" or "Revised" License
85 stars 19 forks source link

Is there a way to use the promote_moderator command with custom channel type? #55

Closed bogy0 closed 3 years ago

bogy0 commented 3 years ago

we like to use the chat:channel:promote_moderator command in a custom channel type, but in the CLI there are only predefined channel types. is there a way to specify a custom channeltype?

What type of channel is this?
- Livestream
- Messaging
- Gaming
- Commerce
- Team

gz#9834

bogy0 commented 3 years ago

this line is susp for me: https://github.com/GetStream/stream-cli/blob/edabec38f5c179c6f3675688af800a2babb05d5f/src/commands/chat/channel/promote_moderator.js#L12

maybe there we should use a user flag:

try {
            if (!flags.channel || !flags.type || !flags.user) {
...
SeniYG commented 3 years ago

Hi,

Thanks for reaching out. Are you having an error when trying to reference one of your custom channel types? If yes can you share this error?

Best,

bogy0 commented 3 years ago

ok so here is what i exactly try: I want to promote a user to moderator one of our custom type channel. For example this channel's type: custom_type1 and the channelID is my_channel1 and here is the user's userID: user_12345

so my command will be:

> stream chat:channel:promote_moderator --type="custom_type1" --channel="my_channel1" --user="user_12345"

After I run this command it seems to me, the Stream CLI ignores the flags and prompt me for the ChannelID input:

? What is the unique identifier for the channel? ›

The next step is this:

? What type of channel is this? …
❯ Livestream
  Messaging
  Gaming
  Commerce
  Team

So I this last step there is no option to input my custom channel type.

bogy0 commented 3 years ago

But i created a pull request which I think will solves this issue: https://github.com/GetStream/stream-cli/pull/56

SeniYG commented 3 years ago

Hi,

Thanks for those details and PR. @ferhatelmas, could you help with this?