From 9adb43183b1485a0a574307d1931201264b22721 Mon Sep 17 00:00:00 2001 From: 57960-dev <120347188+57960-dev@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:37:14 -0500 Subject: [PATCH] Update twitter-bot Implemented multiple users functionality for Twitter bots. --- zulip/integrations/twitter/twitter-bot | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/zulip/integrations/twitter/twitter-bot b/zulip/integrations/twitter/twitter-bot index 15823f488..c67f090de 100755 --- a/zulip/integrations/twitter/twitter-bot +++ b/zulip/integrations/twitter/twitter-bot @@ -109,9 +109,16 @@ if opts.search_terms: CONFIGFILE_INTERNAL = os.path.expanduser("~/.zulip_twitterrc_fetchsearch") elif opts.twitter_name: client_type = "ZulipTwitter/" - CONFIGFILE_INTERNAL = os.path.expanduser("~/.zulip_twitteruserrc_fetchuser") + for name in opts.twitter_name: + if name not in opts.excluded_users: + config_search_multiple_users += name.replace('@', '') + else: + print("Excluded users appears in the users list.") + CONFIGFILE_INTERNAL = os.path.expanduser("~/.zulip_twitteruserrc_fetchuser_" + + config_search_multiple_users) else: - parser.error("You must either specify a search term or a username.") + parser.print_help() + parser.error("You must either specify a search term or a list of usernames.") try: config = ConfigParser()