Advertisement
Guest User

Untitled

a guest
Jan 7th, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. var weather = {
  2. command: function(args, cb, mode)
  3. {
  4. var query = args.toString().toUpperCase();
  5.  
  6. if(!query || (query.length !== 3 && query.length !== 4))
  7. {
  8. args.directreply('You must specify a 3-letter IATA or 4-letter ICAO airport code - e.g. `!!weather LPL` or `!!weather KJFK`');
  9. return;
  10. }
  11.  
  12. IO.jsonp({
  13. url: 'http://dannybeckett.co.uk/AviationBot/Weather.php',
  14. jsonpName: 'callback',
  15. fun: finish,
  16. data: {
  17. a: query
  18. }
  19. });
  20.  
  21. var output = 'something'
  22.  
  23. function finish(resp)
  24. {
  25. args.directreply(output);
  26. }
  27. }
  28. };
  29.  
  30. bot.addCommand({
  31. name: 'weather',
  32. fun: weather.command,
  33. 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`',
  34. async: true,
  35. permissions: {
  36. del: 'NONE'
  37. }
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement