async function startTyping(channelId) {
  const channel = await cacheHandlers.get("channels", channelId);
  // If the channel is cached, we can do extra checks/safety
  if (channel) {
    if (
      ![
        DiscordChannelTypes.DM,
        DiscordChannelTypes.GuildNews,
        DiscordChannelTypes.GuildText,
        DiscordChannelTypes.GuildNewsThread,
        DiscordChannelTypes.GuildPivateThread,
        DiscordChannelTypes.GuildPublicThread,
      ].includes(channel.type)
    ) {
      throw new Error(Errors.CHANNEL_NOT_TEXT_BASED);
    }
    const hasSendMessagesPerm = await botHasChannelPermissions(channelId, [
      "SEND_MESSAGES",
    ]);
    if (!hasSendMessagesPerm) {
      throw new Error(Errors.MISSING_SEND_MESSAGES);
    }
  }
  return await rest.runMethod("post", endpoints.CHANNEL_TYPING(channelId));
}
/**
 * Trigger a typing indicator for the specified channel. Generally bots should **NOT** implement this route.
 * However, if a bot is responding to a command and expects the computation to take a few seconds,
 * this endpoint may be called to let the user know that the bot is processing their message.
 */
Trigger a typing indicator for the specified channel. Generally bots should **NOT** implement this route.
However, if a bot is responding to a command and expects the computation to take a few seconds,
this endpoint may be called to let the user know that the bot is processing their message.
Trigger a typing indicator for the specified channel . Generally bots should ** NOT ** implement this route . However if a bot is responding to a command and expects the computation to take a few seconds this endpoint may be called to let the user know that the bot is processing their message .
async function startTyping(channelId) {
  const channel = await cacheHandlers.get("channels", channelId);
  if (channel) {
    if (
      ![
        DiscordChannelTypes.DM,
        DiscordChannelTypes.GuildNews,
        DiscordChannelTypes.GuildText,
        DiscordChannelTypes.GuildNewsThread,
        DiscordChannelTypes.GuildPivateThread,
        DiscordChannelTypes.GuildPublicThread,
      ].includes(channel.type)
    ) {
      throw new Error(Errors.CHANNEL_NOT_TEXT_BASED);
    }
    const hasSendMessagesPerm = await botHasChannelPermissions(channelId, [
      "SEND_MESSAGES",
    ]);
    if (!hasSendMessagesPerm) {
      throw new Error(Errors.MISSING_SEND_MESSAGES);
    }
  }
  return await rest.runMethod("post", endpoints.CHANNEL_TYPING(channelId));
}
async function startTyping ( channelId ) { const channel = await cacheHandlers . get ( "channels" , channelId ) ; if ( channel ) { if ( ! [ DiscordChannelTypes . DM , DiscordChannelTypes . GuildNews , DiscordChannelTypes . GuildText , DiscordChannelTypes . GuildNewsThread , DiscordChannelTypes . GuildPivateThread , DiscordChannelTypes . GuildPublicThread , ] . includes ( channel . type ) ) { throw new Error ( Errors . CHANNEL_NOT_TEXT_BASED ) ; } const hasSendMessagesPerm = await botHasChannelPermissions ( channelId , [ "SEND_MESSAGES" , ] ) ; if ( ! hasSendMessagesPerm ) { throw new Error ( Errors . MISSING_SEND_MESSAGES ) ; } } return await rest . runMethod ( "post" , endpoints . CHANNEL_TYPING ( channelId ) ) ; }
Trigger a typing indicator for the specified channel.
Trigger a typing indicator for the specified channel .
// If the channel is cached, we can do extra checks/safety