mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-07 21:28:28 +02:00
optimised a bit the code
This commit is contained in:
parent
5f14d0493a
commit
6335514f0c
1 changed files with 4 additions and 6 deletions
|
@ -117,9 +117,8 @@ async def on_ready():
|
||||||
image = get_track_minimap(track)
|
image = get_track_minimap(track)
|
||||||
image.save(image_binary, "PNG")
|
image.save(image_binary, "PNG")
|
||||||
image_binary.seek(0)
|
image_binary.seek(0)
|
||||||
|
|
||||||
message_minimap = await data_channel.send(
|
message_minimap = await data_channel.send(
|
||||||
file=discord.File(fp=image_binary, filename="minimap.png"))
|
file=discord.File(fp=image_binary, filename=f"minimap {track.sha1}.png"))
|
||||||
embed.set_thumbnail(url=message_minimap.attachments[0].url)
|
embed.set_thumbnail(url=message_minimap.attachments[0].url)
|
||||||
|
|
||||||
message = await track_channel.send(embed=embed)
|
message = await track_channel.send(embed=embed)
|
||||||
|
@ -129,11 +128,10 @@ async def on_ready():
|
||||||
await message.add_reaction("❌")
|
await message.add_reaction("❌")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if hasattr(track, "sha1"):
|
message = message_from_sha1[track.sha1]
|
||||||
message = message_from_sha1[track.sha1]
|
await message.edit(embed=embed)
|
||||||
await message.edit(embed=embed)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"error for track {track.name} : {str(e)}")
|
print(f"error for track {track.name} : {str(e)}")
|
||||||
|
|
||||||
bot.run(os.environ['DISCORD_GR_TOKEN'])
|
bot.run(os.environ['DISCORD_GR_TOKEN'])
|
||||||
|
|
Loading…
Reference in a new issue