aboutsummaryrefslogtreecommitdiff
path: root/modules/location.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/location.py')
-rw-r--r--modules/location.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/location.py b/modules/location.py
index 1858a915..dfef9244 100644
--- a/modules/location.py
+++ b/modules/location.py
@@ -14,11 +14,10 @@ class Module(ModuleManager.BaseModule):
self.exports.add("get-location", self._get_location)
def _get_location(self, s):
- page = utils.http.request(URL_OPENCAGE, get_params={
- "q": s, "key": self.bot.config["opencagedata-api-key"], "limit": "1"
- }, json=True)
- if page and page.data["results"]:
- result = page.data["results"][0]
+ page = utils.http.request(URL_OPENCAGE, get_params={"limit": "1",
+ "q": s, "key": self.bot.config["opencagedata-api-key"]}).json()
+ if page and page["results"]:
+ result = page["results"][0]
timezone = result["annotations"]["timezone"]["name"]
lat = result["geometry"]["lat"]
lon = result["geometry"]["lng"]