Skip to content

Commit 970c5bf

Browse files
committed
Work out the warnings
This PR update the follow: - await bot.logout to bot.close - polygons = list(self.polygon) to polygons = list(self.polygon.geoms) @thank to Malte for help. This wil limit the warnings.
1 parent 65c90f0 commit 970c5bf

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

nests.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ def timestr_to_datetime(time):
184184
queries.close()
185185

186186
# Discord stuff
187-
188187
discord_webhook_data = []
189-
discord_message_data = []
188+
discord_message_data = []
190189

191190
for area in full_areas:
192191
if len(area.nests) == 0:
@@ -232,7 +231,7 @@ async def on_ready():
232231
log.exception(e)
233232
except Exception as e:
234233
log.exception(e)
235-
await bot.logout()
234+
await bot.close()
236235

237236
bot.run(config.discord_token)
238237

@@ -249,7 +248,7 @@ async def on_ready():
249248
@bot.event
250249
async def on_ready():
251250
bot.emote_refs = await get_emotes(bot, nesting_mons, config)
252-
await bot.logout()
251+
await bot.close()
253252
bot.run(config.discord_token)
254253
emote_refs = bot.emote_refs
255254

@@ -285,5 +284,4 @@ async def on_ready():
285284
log.success(f"Sent Webhook for {area.name} ({r.status_code})")
286285
time.sleep(1)
287286

288-
289-
log.success("All done.")
287+
log.success("All done.")

nestwatcher/area.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def get_polys(lss):
399399
self.polygon = final_polygon
400400

401401
if isinstance(self.polygon, geometry.MultiPolygon):
402-
polygons = list(self.polygon)
402+
polygons = list(self.polygon.geoms)
403403
else:
404404
polygons = [self.polygon]
405405

0 commit comments

Comments
 (0)