mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
User-Agent for all requests
This commit is contained in:
@@ -32,6 +32,9 @@ class DefineCommand extends commando.Command {
|
|||||||
includeTags: false,
|
includeTags: false,
|
||||||
api_key: config.wordnikkey
|
api_key: config.wordnikkey
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(options).then(function (response) {
|
request(options).then(function (response) {
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ class OsuCommand extends commando.Command {
|
|||||||
u: usernametosearch,
|
u: usernametosearch,
|
||||||
type: "string"
|
type: "string"
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(options).then(function (response) {
|
request(options).then(function (response) {
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ class WattpadCommand extends commando.Command {
|
|||||||
query: querybook,
|
query: querybook,
|
||||||
limit: 1
|
limit: 1
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(options).then(function (response) {
|
request(options).then(function (response) {
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ class WikipediaCommand extends commando.Command {
|
|||||||
const options = {
|
const options = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
uri: "https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + wikied + "&exintro=&explaintext=&redirects=&formatversion=2",
|
uri: "https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=" + wikied + "&exintro=&explaintext=&redirects=&formatversion=2",
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(options).then(function (response) {
|
request(options).then(function (response) {
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ class YouTubeCommand extends commando.Command {
|
|||||||
order: 'viewCount',
|
order: 'viewCount',
|
||||||
key: config.youtubekey
|
key: config.youtubekey
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(options).then(function (response) {
|
request(options).then(function (response) {
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ class YuGiOhCommand extends commando.Command {
|
|||||||
const options = {
|
const options = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
uri: 'http://yugiohprices.com/api/card_data/' + cardname,
|
uri: 'http://yugiohprices.com/api/card_data/' + cardname,
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(options).then(function (response) {
|
request(options).then(function (response) {
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ class YodaCommand extends commando.Command {
|
|||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'X-Mashape-Key': config.mashapekey,
|
'X-Mashape-Key': config.mashapekey,
|
||||||
'Accept': "text/plain"
|
'Accept': "text/plain",
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
},
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ client.on('message', (message) => {
|
|||||||
body: {
|
body: {
|
||||||
content: messagecontent
|
content: messagecontent
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
request(sendPOST).then(function (parsedBody) {
|
request(sendPOST).then(function (parsedBody) {
|
||||||
@@ -122,6 +125,9 @@ client.on('guildCreate', guild => {
|
|||||||
key: config.carbonkey,
|
key: config.carbonkey,
|
||||||
servercount: results.reduce((prev, val) => prev + val, 0)
|
servercount: results.reduce((prev, val) => prev + val, 0)
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
const DBotsPOST = {
|
const DBotsPOST = {
|
||||||
@@ -131,7 +137,8 @@ client.on('guildCreate', guild => {
|
|||||||
server_count: results.reduce((prev, val) => prev + val, 0)
|
server_count: results.reduce((prev, val) => prev + val, 0)
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': config.botskey
|
'Authorization': config.botskey,
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
},
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
@@ -159,6 +166,9 @@ client.on('guildDelete', guild => {
|
|||||||
key: config.carbonkey,
|
key: config.carbonkey,
|
||||||
servercount: results.reduce((prev, val) => prev + val, 0)
|
servercount: results.reduce((prev, val) => prev + val, 0)
|
||||||
},
|
},
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
const DBotsPOST = {
|
const DBotsPOST = {
|
||||||
@@ -168,7 +178,8 @@ client.on('guildDelete', guild => {
|
|||||||
server_count: results.reduce((prev, val) => prev + val, 0)
|
server_count: results.reduce((prev, val) => prev + val, 0)
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': config.botskey
|
'Authorization': config.botskey,
|
||||||
|
'User-Agent': 'XiaoBot - dragonfire535 (http://dragonfire535.tk)'
|
||||||
},
|
},
|
||||||
json: true
|
json: true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user