mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-09-01 01:35:17 +00:00
Merge pull request #40 from MSFTserver/patch-12
This commit is contained in:
commit
fc71fcc956
1 changed files with 49 additions and 0 deletions
49
bot/modules/releasenotes
Normal file
49
bot/modules/releasenotes
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
var request = require('request');
|
||||||
|
|
||||||
|
exports.commands = [
|
||||||
|
"releasenotes" // command that is in this file, every command needs it own export as shown below
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
exports.releasenotes = {
|
||||||
|
usage: "",
|
||||||
|
description: 'gets current release notes from GITHUB',
|
||||||
|
process: function(bot,msg){
|
||||||
|
var headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': 'Super Agent/0.0.1'
|
||||||
|
}
|
||||||
|
// Configure the request
|
||||||
|
var options = {
|
||||||
|
url: 'https://api.github.com/repos/lbryio/lbry-app/releases/latest',
|
||||||
|
method: 'GET',
|
||||||
|
headers: headers,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the request
|
||||||
|
request(options, function (error, response, body) {
|
||||||
|
releasemessage = JSON.parse(body).body
|
||||||
|
releasename = JSON.parse(body).name
|
||||||
|
releasedate = JSON.parse(body).published_at
|
||||||
|
releaseurl = JSON.parse(body).html_url
|
||||||
|
msg.author.send({
|
||||||
|
"embed": {
|
||||||
|
"title": "*Download " + releasename + " here!*",
|
||||||
|
"description": releasemessage,
|
||||||
|
"url": releaseurl,
|
||||||
|
"color": 7976557,
|
||||||
|
"timestamp": releasedate,
|
||||||
|
"author": {
|
||||||
|
"name": "Lbry-app Release Notes for " + releasename,
|
||||||
|
"icon_url": "http://www.pngall.com/wp-content/uploads/2016/04/Github-PNG-Image.png"
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"icon_url": "https://i.imgur.com/yWf5USu.png",
|
||||||
|
"text": "Lbry-app Updated "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue