I want to make python code that opens a file reads first 2 lines and send resoults using discord webhook

117
January 22, 2022, at 7:40 PM

i have this core right now and it doesn't work if anyone could help it would be great

import aiohttp
from discord import Webhook, AsyncWebhookAdapter
a_file = open("path......")
lines_to_read = [0, 2] # line indexs starting with 0 so first line = 0 second = 1...
for position, line in enumerate(a_file):
    if position in lines_to_read:
        print(line)
with open('latest.log', encoding='utf8') as f:
    data = f
async with aiohttp.ClientSession() as session:
    webhook = Webhook.from_url(
    "https://discord.com/api/webhook........"),
        adapter=AsyncWebhookAdapter(session))
    await webhook.send(content=data)
Rent Charter Buses Company
READ ALSO
production Deploy symfony error symfony 5

production Deploy symfony error symfony 5

Hello i tried to deploy my symfony app using symfony deploy documentation command and i got this error on my Navigator

107
How do I add the date and next in a AS column

How do I add the date and next in a AS column

How do I add the date and next in a AS column? for example: enter image description here

125
How to make a scoreboard in Java [closed]

How to make a scoreboard in Java [closed]

Want to improve this question? Update the question so it focuses on one problem only by editing this post

740
All colors gone after adding custom color in tailwind [duplicate]

All colors gone after adding custom color in tailwind [duplicate]

I just added a custom color to tailwind like this:

130