Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var weather = {
- command: function(args, cb, mode)
- {
- var query = args.toString().toUpperCase();
- if(!query || (query.length !== 3 && query.length !== 4))
- {
- args.directreply('You must specify a 3-letter IATA or 4-letter ICAO airport code - e.g. `!!weather LPL` or `!!weather KJFK`');
- return;
- }
- IO.jsonp({
- url: 'http://dannybeckett.co.uk/AviationBot/Weather.php',
- jsonpName: 'callback',
- fun: finish,
- data: {
- a: query
- }
- });
- function finish(resp)
- {
- var output = 'something';
- args.directreply(output);
- }
- }
- };
- bot.addCommand({
- name: 'weather',
- fun: weather.command,
- description: 'Retrieves the translated METAR weather data for a specified 3-letter IATA or 4-letter ICAO airport code - e.g. `!!weather LPL` or `!!weather KJFK`',
- async: true,
- permissions: {
- del: 'NONE'
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement