Search code examples
google-hangouts

Is there a syntax to specify multiline code snippets in Google (Hangouts) Chat?


I would like something like the Markdown options (of SO?), where

four leading spaces makes it look like code
blocks have been written

Solution

  • Google (Hangouts) Chat only supports basic (not rich nor full Markdown) formatting. For your specific inquiry, use pairs of triple backticks, i.e.,

    ```
    Hello
    World
    ```
    

    For this and other formatting directives, see either the consumer help page (for end-users), or the format messages page (for developers) in Google's documentation.

    For those who are developers and want to build Google Chat apps/bots, I was part of the launch team back in 2018 and produced some video content to help you get started:

    • Take a look at the developer intro and Google I/O launch videos. The intro shows you how to build (synchronous) bots that respond in real-time to user requests with an @BOT message.
    • You can also write bots/apps that send alerts or notifications in an asynchronous manner. For information on how to do that, check out the 2nd developers video.