import discord

client = discord.Client()

source_channel_ids = [
    1339350982156353637, #2330
    1339351034862243961, #2331
    1339351244631707803, #2332
    1339351289162629120, #2333
    1339351328073322606, #2334
    1339352021605683220, #1330
    1339354217634205738, #1331
    1339354293966213140, #1332
    1339354551454535710, #1333
    1339354567636418570, #1334
    1339354587152257125, #1335
    1339354602700537906, #1336
    1339354615287779398, #1337
    1339354629523112118, #1338
    1339354658275328141, #1339
]

otp_received_channel_id = 1338435527577440306 

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.channel.id in source_channel_ids:
        if message.embeds:
            for embed in message.embeds:
                for field in embed.fields:
                    if "OTP:" in field.value:
                        otp_received_channel = client.get_channel(otp_received_channel_id)
                        if otp_received_channel:
                            print("OTP Found. Message has been forwarded")
                            await otp_received_channel.send(embed=embed)
                        break 

client.run('MTE0MTQwOTAyNjAyMjg0MjM4OA.G_p_lX.LsCjLzmStw4pmM5wZUu4VVgCajSnOpCGj4fbTQ')
