Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.04 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.04 KB

wire-weahter-bot

Weather bot on Wire.com web-app

  1. Open Bot on heroku
  2. Add bot account malos to your wire
  3. Start chatting /weather [city]

the following code for an "echo bot" is provided:

Package Installation

npm i --save @wireapp/core@0.0.30

Demo Code (echo-bot.js)

const {Account} = require('@wireapp/core');

const account = new Account();

account.on(Account.INCOMING.TEXT_MESSAGE, ({conversation, content}) => {
  account.service.conversation.sendTextMessage(conversation, `Echo: ${content}`);
});

account.listen({
  email: 'yourbot@email.com',
  password: 'top-secret',
  persist: false,
});

To retrieve the weather data, you can use any external weather service you like, such as openweathermap.org and others.

Input examples

Incorrect input

  • Given Input: /weather
  • Expected Output: nothing

Correct input

  • Given Input: /weather [city]
  • Expected Output: The temperature in Berlin is [degrees]°C.