【问题标题】:Is there a way to send multiple messages at once using Instabot?有没有办法使用 Instabot 一次发送多条消息?
【发布时间】:2021-06-07 05:25:44
【问题描述】:

我正在进行一项调查,我想将其发送给我学校的多个 Instagram 用户。为此,我使用 instabot 和 python 向他们发送消息。我目前能够在每次运行程序时向一个用户发送消息。这是我到目前为止的代码:

from instabot import Bot

bot = Bot()
bot.login(username="myUsername", password="myPassword")

list = ["randomUsername1", "randomUsername2", "randomUsername3"]

for x in list:
    bot.send_message("This is a test", [x])

如何使用循环而不是手动向每个用户发送消息?

【问题讨论】:

    标签: python performance loops for-loop instagram


    【解决方案1】:
    bot.send_message("This is a test", ["user1", "user2", "user3"])
    

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2023-01-30
    • 1970-01-01
    • 2021-10-08
    • 2023-03-27
    • 1970-01-01
    • 2021-07-23
    • 2018-03-21
    • 2019-11-18
    • 2023-01-24
    相关资源
    最近更新 更多