import pika
import get_ip as ip
from settings import USER, PASS, HOST, PORT

def send(message):

    message = str(message)

    credentials = pika.PlainCredentials(username=USER, password=PASS)


    connection = pika.BlockingConnection(pika.ConnectionParameters(
        host=HOST, port=PORT, credentials=credentials))


    channel = connection.channel()

    channel.queue_declare(queue='hello')

    channel.basic_publish(exchange='',
                          routing_key='hello',
                          body=message)
    connection.close()

    return "Message Sent"
