def _post_message(channel, message, username, as_user, api_key=None):
 parameters = dict()
 parameters['channel'] = channel
 parameters['username'] = username
 parameters['as_user'] = as_user
 parameters['text'] = (('```' + message) + '```')
 result = salt.utils.slack.query(function='message', api_key=api_key, method='POST', header_dict={'Content-Type': 'application/x-www-form-urlencoded'}, data=urllib.urlencode(parameters))
 log.debug('result {0}'.format(result))
 if result:
  return True
 else:
  return False

def _post_message ( channel , message , username , as_user , api_key = None ) : parameters = dict ( ) parameters [ 'channel' ] = channel parameters [ 'username' ] = username parameters [ 'as_user' ] = as_user parameters [ 'text' ] = ( ( '```' + message ) + '```' ) result = salt . utils . slack . query ( function = 'message' , api_key = api_key , method = 'POST' , header_dict = { 'Content-Type' : 'application/x-www-form-urlencoded' } , data = urllib . urlencode ( parameters ) ) log . debug ( 'result {0}' . format ( result ) ) if result : return True else : return False
send a message to a pushover user or group .