Q:

SlackAPI - Trouble returning message with multiple variables

I have the following code for my Slack bot:
    if command.startswith(COMMAND_FIVE):
        owm = pyowm.OWM()

        owm.set_API_key('')
        observation = owm.weather_at_id(4744326)
        w = observation.get_weather()
        jsondata= w.get_temperature('fahrenheit')
        RESPOND = ("The current temperature (Fahrenheit) is:",(jsondata["temp"]),"\nThe high is:",(jsondata["temp_max"]),"\nThe low is:",(jsondata["temp_min"]),"\n*Note: This can change*")
        response = (RESPOND)
        print("Someone got the weather.")

    # Sends the response back to the channel
    slack_client.api_call(
        "chat.postMessage",
        channel=channel,
        text=response or default_response
    )

When I call this command, I get the following back:

How can i format the message so it returns everything, not just the bottom line?

A:

The reason your code that does not produce the expected result, is that you are passing your text as a tuple of strings to the API method. Apparently the API method is reducing that internally to just one element (the last).
To make this work you want to pass your text as one complete string to the API method's text property.
Here is a new version of your code that should work better:
RESPOND = [
    "The current temperature (Fahrenheit) is: {0:.2f}".format(jsondata["temp"]),
    "The high is: {0:.2f}".format(jsondata["temp_max"]),
    "The low is: {0:.2f}".format(jsondata["temp_min"]),
    "*Note: This can change*"]
response = "\n".join(RESPOND)

