No more backup lanyard to keep info up to date
This commit is contained in:
parent
36e771a57c
commit
0abbaa8470
3 changed files with 14 additions and 87 deletions
|
@ -256,8 +256,10 @@ function converter(html, dynamic = true) {
|
|||
"COMMIT_COUNT": commitCount,
|
||||
"QUOTE_COUNT": quotes.length,
|
||||
"DISCORD_STATUS": () => {
|
||||
return `<span style="color: ${constants.discStatuses[api.lanyard.discord_status].color};" class="statusColor">${constants.discStatuses[api.lanyard.discord_status].text}</span>` +
|
||||
if (api.lanyard) {
|
||||
return `<span style="color: ${constants.discStatuses[api.lanyard.discord_status].color};" class="statusColor">${constants.discStatuses[api.lanyard.discord_status].text}</span>` +
|
||||
`<style>.pfp { border-color: ${constants.discStatuses[api.lanyard.discord_status].color} }</style>`;
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
@ -269,7 +271,7 @@ function converter(html, dynamic = true) {
|
|||
<a class="chip" href="/blog">Blog</a></h3>
|
||||
</div>`,
|
||||
"CUSTOM_STATUS": () => {
|
||||
if (api.lanyard.custom_status) {
|
||||
if (api.lanyard && api.lanyard.custom_status) {
|
||||
var status = api.lanyard.custom_status
|
||||
var addedHTML = "<hr/><p>"
|
||||
if (status.emoji) {
|
||||
|
@ -287,7 +289,7 @@ function converter(html, dynamic = true) {
|
|||
return ""
|
||||
},
|
||||
"SELECTED_VIDEO": () => {
|
||||
if (api.lanyard.video) {
|
||||
if (api.lanyard && api.lanyard.video) {
|
||||
return `<h2><hr/>Random video!</h2><p>I would call it random <em>daily</em> video but its not at all daily...</p>
|
||||
<br/>
|
||||
<video controls="true" src="${api.lanyard.video.url}"></video>`
|
||||
|
@ -298,9 +300,9 @@ function converter(html, dynamic = true) {
|
|||
"WEATHER_TEXT": "",
|
||||
"ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html")),
|
||||
"SOCIALS": () => {
|
||||
if (api.lanyard.socials) {
|
||||
if (api.lanyard && api.lanyard.socials) {
|
||||
var socials = api.lanyard.socials
|
||||
var html = ""
|
||||
var html = `<div class="grid-container">`
|
||||
var socialsTable = Object.keys(socials)
|
||||
for (var i = 0; i < socialsTable.length; i++) {
|
||||
var category = socialsTable[i]
|
||||
|
@ -315,6 +317,9 @@ function converter(html, dynamic = true) {
|
|||
}
|
||||
html += "</div></div>"
|
||||
}
|
||||
html += "</div>"
|
||||
} else {
|
||||
html = "<h2>Failed to load?!</h2><p>Uh oh</p>"
|
||||
}
|
||||
return html
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue