Browse Source

try to fix adfiles error

master
Ev Bogue 3 years ago
parent
commit
8da504b074
  1. 2
      server.js

2
server.js

@ -158,7 +158,7 @@ bog.keys().then(key => {
if (config.ads) {
if (Math.floor(Math.random() * 6) == 2) {
fs.readdir(addir, function (err, adfiles) {
if (adfiles[0]) {
if (adfiles) {
var num = Math.floor(Math.random() * (adfiles.length))
fs.readFile(addir + adfiles[num], 'UTF-8', function (err, adFile) {
var obj = JSON.parse(adFile)

Loading…
Cancel
Save