python - 这个 .py 可以有多个短语吗?

标签 python twitter bots

Bot.py(我正在使用的)

#!/usr/bin/env python

from TwitterFollowBot import TwitterBot
my_bot = TwitterBot("/Home/TwitterFollowBot/config.txt")  
my_bot.sync_follows()
my_bot.auto_rt("@ShoutGamers", count=2200)

所以基本上我正在使用这个TwitterFollowBot机器人自动转发任何包含“@ShoutGamers”的推文。

默认.py

from TwitterFollowBot import TwitterBot
my_bot = TwitterBot()
my_bot.auto_fav("phrase", count=1000)

我想知道如何添加多个短语? 我需要将这两个短语添加到 @ShoutGamers 和 @RtwtKing 中。

最佳答案

就像添加 2 个字符串一样简单。

如果您想在一条推文中自动转发同时包含 @ShoutGamers@RtwtKing 的推文,您可以:

my_bot.auto_rt("@ShoutGamers @RtwtKing", count=2200)

如果您想自动转发 @ShoutGamers@RtwtKing 不在一起的推文,您可以使用 bot.auto_rt() 两次:

my_bot.auto_rt("@ShoutGamers", count=2200)
my_bot.auto_rt("@RtwtKing", count=2200)

关于python - 这个 .py 可以有多个短语吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40820743/

相关文章:

python - python 中的策划者

python - 编写一个 pytest 函数来检查控制台上的输出(stdout)

mysql - 机器人筛选网站的每个页面

node.js - Microsoft Azure LUIS 应用程序模拟器没有回复

python - 在不使用 for 循环的情况下创建数据框的子集

python - 这个特定参数如何接收值?

android - Twitter4j : Send Direct Messages to more than 250 followers

sql-server - Azure 逻辑应用程序 - Twitter 和 MS SQL 连接器问题

java - twitter4j geo 流媒体香港的纬度/经度

javascript - 机器人不会等待 react ,而且由于 Emded 错误,他在收集时也不会发送消息