mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 17:47:27 +00:00
Merge pull request #42 from MSFTserver/patch-13
fixed releasenotes bot [done]
This commit is contained in:
commit
b10c7448a3
1 changed files with 13 additions and 19 deletions
|
@ -1,4 +1,6 @@
|
||||||
var request = require('request');
|
var request = require('request');
|
||||||
|
let hasPerms = require('../helpers.js').hasPerms;
|
||||||
|
|
||||||
|
|
||||||
exports.commands = [
|
exports.commands = [
|
||||||
"releasenotes" // command that is in this file, every command needs it own export as shown below
|
"releasenotes" // command that is in this file, every command needs it own export as shown below
|
||||||
|
@ -8,7 +10,8 @@ exports.commands = [
|
||||||
exports.releasenotes = {
|
exports.releasenotes = {
|
||||||
usage: "",
|
usage: "",
|
||||||
description: 'gets current release notes from GITHUB',
|
description: 'gets current release notes from GITHUB',
|
||||||
process: function(bot,msg){
|
process: function(bot,msg,suffix){
|
||||||
|
|
||||||
var headers = {
|
var headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'User-Agent': 'Super Agent/0.0.1'
|
'User-Agent': 'Super Agent/0.0.1'
|
||||||
|
@ -26,23 +29,14 @@ exports.releasenotes = {
|
||||||
releasename = JSON.parse(body).name
|
releasename = JSON.parse(body).name
|
||||||
releasedate = JSON.parse(body).published_at
|
releasedate = JSON.parse(body).published_at
|
||||||
releaseurl = JSON.parse(body).html_url
|
releaseurl = JSON.parse(body).html_url
|
||||||
msg.author.send({
|
message = {"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 "}}}
|
||||||
"embed": {
|
if ( hasPerms(msg) === true && suffix === "post") {
|
||||||
"title": "*Download " + releasename + " here!*",
|
var channelID = "370779899650375681"
|
||||||
"description": releasemessage,
|
bot.channels.get(channelID).send(message)
|
||||||
"url": releaseurl,
|
} else {
|
||||||
"color": 7976557,
|
msg.channel.send(msg.author + " Release notes sent via DM")
|
||||||
"timestamp": releasedate,
|
msg.author.send(message)
|
||||||
"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