FalltoSkyBot.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:FalltoSkyBot 作者: Sakiut 项目源码 文件源码
def my_background_task():
    client = discord.Client()
    await client.wait_until_ready()
    channel = discord.Object(id='189472786056478720')
    feed = youtube.start()
    while not client.is_closed:
        update = youtube.update(feed)
        if update != "304":
            entry = youtube.getLastEntry()
            YTEmbed = discord.Embed()
            YTEmbed.colour = 0x3498db
            YTEmbed.title = "Nouvelle vidéo sur la chaîne de Sakiut ! `" + entry['title'] + "`"
            YTEmbed.description = "Vidéo : " + entry['link'] + "\nChaîne : " + entry['channel'] + "\nPosté le : " + entry['published']
            YTEmbed.set_thumbnail(url = entry['thumbnail'])
            YTEmbed.set_footer(text = "Posté par {0}".format(entry['author']))
            await client.send_message(channel, "@everyone", embed = YTEmbed)
        feed = youtube.start()
        await asyncio.sleep(300)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号