Added messageid to all messages

I'm not sure if this fixes the issue of adding message ids to all messages. Maybe you could review it and give me enough feedback for me to fix it? I haven't coded a single line of Python before today, so any help is appreciated :)