Registered the chat event and made the ChatEvent class a listener