hyfetch/tools/issue_whitelist.py

22 lines
580 B
Python
Raw Normal View History

2023-01-14 14:02:37 -07:00
import os
import time
from github import Github
if __name__ == '__main__':
gh = Github(per_page=100, login_or_token=os.environ.get('GH_TOKEN'))
repo = gh.get_repo("hykilpikonna/hyfetch")
while True:
2023-01-14 14:11:27 -07:00
iss = repo.get_issues(state='open')
2023-01-14 14:02:37 -07:00
for i in iss:
if i.user.login in ['Symbolic11']:
2023-01-14 14:11:27 -07:00
i.edit(title="[Redacted]", body="[Redacted by Content Moderation Bot]", state="closed")
2023-01-14 14:02:37 -07:00
i.create_comment("Issue closed by bot for offensive content.")
print(f"Closed {i.number}")
time.sleep(2)