Added Header information to requests

This commit is contained in:
Robert 2020-08-11 14:07:12 +02:00
parent f150d9bc97
commit f27d195964
2 changed files with 9 additions and 2 deletions

View file

@ -28,5 +28,8 @@ Clone this repo, create a `config.json` in the root directory with the following
{ {
"key": Your discord bot token, "key": Your discord bot token,
"prefix": Your prefix "prefix": Your prefix,
} }
If there a re questions or requests you can find me on discord: `Lauchmelder#1234`

View file

@ -3,6 +3,10 @@ import urllib.parse
import json import json
TEMPLATE_URL = "https://jisho.org/api/v1/search/words?keyword={0}" TEMPLATE_URL = "https://jisho.org/api/v1/search/words?keyword={0}"
HEADER = {
"User-Agent": "Jisho Bot",
"From": "https://github.com/Lauchmelder23/JishoBot"
}
class JishoSenses(): class JishoSenses():
def __init__(self, sense): def __init__(self, sense):