I want to Send a Message to multiple Servers at once. with the help of Stackoverflow I came up with a solution like this here. But I don't know how to get this code Working.
async def sendmessages(embed):
ids = []
for channel in fetchedchannel:
m = await channel.send(embed = embed)
ids.append(m.id)
return ids
ids = []
try:
ids = await asyncio.gather(sendmessage(embed))
except:
pass
print(ids)
The variable fetchedchannel is a list with all the Channels the message should be sent to.
The output I expect is something like [541654984561689, 848594981654894, 549846898948489, 84869489785156489]
What I get is []