From c6ed4cedb77fb7d2bb4776e49d8ebe8657645cab Mon Sep 17 00:00:00 2001 From: HoeenHero Date: Mon, 18 Feb 2019 08:39:53 -0500 Subject: [PATCH] TCG: Update wiki domain --- server/chat-plugins/tcgtabletop.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/chat-plugins/tcgtabletop.js b/server/chat-plugins/tcgtabletop.js index a325b59b0c..41f8bed0c7 100644 --- a/server/chat-plugins/tcgtabletop.js +++ b/server/chat-plugins/tcgtabletop.js @@ -25,7 +25,7 @@ function apiRequest(url, onEnd, onError) { function wikiaSearch(subdomain, query) { return new Promise(function (resolve, reject) { - apiRequest(`https://${subdomain}.wikia.com/api/v1/Search/List/?query=${encodeURIComponent(query)}&limit=1`, res => { + apiRequest(`https://${subdomain}.fandom.com/api/v1/Search/List/?query=${encodeURIComponent(query)}&limit=1`, res => { let result; try { result = JSON.parse(res); @@ -42,7 +42,7 @@ function wikiaSearch(subdomain, query) { } function getCardDetails(subdomain, id) { return new Promise(function (resolve, reject) { - apiRequest(`https://${subdomain}.wikia.com/api/v1/Articles/Details?ids=${encodeURIComponent(id)}&abstract=0&width=80&height=115`, res => { + apiRequest(`https://${subdomain}.fandom.com/api/v1/Articles/Details?ids=${encodeURIComponent(id)}&abstract=0&width=80&height=115`, res => { let result; try { result = JSON.parse(res); @@ -65,6 +65,7 @@ exports.commands = { if (room.id !== 'tcgtabletop') return this.errorReply("This command can only be used in the TCG & Tabletop room."); let subdomain = 'yugioh'; let query = target.trim(); + if (!query) return this.parse('/help yugioh'); wikiaSearch(subdomain, query).then(data => { if (!this.runBroadcast()) return; @@ -105,4 +106,5 @@ exports.commands = { return room.add(`Error: ${err.message}`).update(); }); }, + yugiohhelp: [`/yugioh [query] - Search the Yugioh wiki.`], };