<commit_before>'use strict';
console.log("Go Patrol version:");
console.log("v1.0.2");
const config = require("./config.js");
const pokemonNames = require("./pokemon_names.js");
const TelegramBot = require("./telegramBot.js")
const EventEmitter = require("events");
const request = require('request');
const Pokespotter = require("pokespotter");
const Jimp = require("jimp");

const event = new EventEmitter();
const telegramBot = new TelegramBot(config.telegramBotToken, { polling: true });
const initDate = new Date();
const fifteenMinutes = 900000;
const iconhost = "http://gopatrol.ass.tw/pixel_icons/";
var telegramAdminUsernames = config.telegramAdminUsernames;	// 管理員名單
var centerLocation = config.initCenterLocation;	// 搜尋中心位置
var whitelist = config.whitelist;	// 寶可夢白名單
var blacklist = config.blacklist;	// 寶可夢黑名單
var spotterOptional = {
	steps: config.searchSteps,			// 搜尋範圍
	requestDelay: config.searchDelay * 1000,	// 搜尋延遲
	currentTime: initDate
}
const debug = config.debug;
if (debug) {
	console.log("debug on.")
}
var mapBuffer;
var pokespotters = [];			// 儲存 Spotter 用
pokespotters[0] = Pokespotter(config.account);		// 建立第一個 Spotter
pokespotters[0].runCount = 0;	// 記錄 Spotter 執行次數，用來確認是不是卡住了
var runningSpotterId = 0;		// 記錄目前 Spotter 的 Id，用來確認 Spotter 存活狀態
var isWattingRestart = false;	// 正在重啟中，用來確保不要重複重啟
var isPatrolling = false;		// 巡邏執行狀態
var pokemons = [];				// 儲存的寶可夢
var activeChatIDs = [];			// 啟動中的 Telegram ChatID

// 巡邏
event.on("patrol", function(thisSpotterId) {
	console.log("---------------------------------------------------------------------------\n");
	if (debug) {
		console.log("on patrol event.");
	}<commit_msg>白名單檢查 undefined 後建立空陣列，避免使用者直接用舊版 config 出錯<commit_after>'use strict';
console.log("Go Patrol version:");
console.log("v1.0.2");
const config = require("./config.js");
const pokemonNames = require("./pokemon_names.js");
const TelegramBot = require("./telegramBot.js")
const EventEmitter = require("events");
const request = require('request');
const Pokespotter = require("pokespotter");
const Jimp = require("jimp");

const event = new EventEmitter();
const telegramBot = new TelegramBot(config.telegramBotToken, { polling: true });
const initDate = new Date();
const fifteenMinutes = 900000;
const iconhost = "http://gopatrol.ass.tw/pixel_icons/";
var telegramAdminUsernames = config.telegramAdminUsernames;	// 管理員名單
var centerLocation = config.initCenterLocation;	// 搜尋中心位置
var whitelist = config.whitelist;	// 寶可夢白名單
if (typeof whitelist == undefined) {
	whitelist = [];
}
var blacklist = config.blacklist;	// 寶可夢黑名單
var spotterOptional = {
	steps: config.searchSteps,			// 搜尋範圍
	requestDelay: config.searchDelay * 1000,	// 搜尋延遲
	currentTime: initDate
}
const debug = config.debug;
if (debug) {
	console.log("debug on.")
}
var mapBuffer;
var pokespotters = [];			// 儲存 Spotter 用
pokespotters[0] = Pokespotter(config.account);		// 建立第一個 Spotter
pokespotters[0].runCount = 0;	// 記錄 Spotter 執行次數，用來確認是不是卡住了
var runningSpotterId = 0;		// 記錄目前 Spotter 的 Id，用來確認 Spotter 存活狀態
var isWattingRestart = false;	// 正在重啟中，用來確保不要重複重啟
var isPatrolling = false;		// 巡邏執行狀態
var pokemons = [];				// 儲存的寶可夢
var activeChatIDs = [];			// 啟動中的 Telegram ChatID

// 巡邏
event.on("patrol", function(thisSpotterId) {
	console.log("---------------------------------------------------------------------------\n");
	if (debug) {
		console.log("on patrol event.");
	}
{'fraction_non_alphanumeric': 0.18109540636042404, 'fraction_numerical': 0.010011778563015312, 'mean_word_length': 3.771067415730337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5635942', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1393, 'n_words': 271}