Skip to content

Commit

Permalink
only add channels that the bot is a member of
Browse files Browse the repository at this point in the history
  • Loading branch information
docmarionum1 committed Jan 27, 2021
1 parent 1d0dc85 commit 7e0619a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions archivebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ def update_channels(conn, cursor):
channel_args = []
member_args = []
for channel in channels:
channel_id, channel_name, channel_is_private, members = get_channel_info(
channel["id"]
)
if channel["is_member"]:
channel_id, channel_name, channel_is_private, members = get_channel_info(
channel["id"]
)

channel_args.append((channel_name, channel_id, channel_is_private))
channel_args.append((channel_name, channel_id, channel_is_private))

member_args += members
member_args += members

cursor.executemany(
"INSERT INTO channels(name, id, is_private) VALUES(?,?,?)", channel_args
Expand Down

0 comments on commit 7e0619a

Please sign in to comment.