[+] Issue content moderation bot
This commit is contained in:
parent
3535dd3fcf
commit
6cd2bf4b41
1 changed files with 24 additions and 0 deletions
24
tools/issue_whitelist.py
Normal file
24
tools/issue_whitelist.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
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:
|
||||||
|
iss = repo.get_issues()
|
||||||
|
|
||||||
|
for i in iss:
|
||||||
|
if i.state == 'closed':
|
||||||
|
continue
|
||||||
|
|
||||||
|
if i.user.login in ['Symbolic11']:
|
||||||
|
i.edit(body="[Redacted by Content Moderation Bot]", state="closed")
|
||||||
|
i.create_comment("Issue closed by bot for offensive content.")
|
||||||
|
|
||||||
|
print(f"Closed {i.number}")
|
||||||
|
|
||||||
|
time.sleep(2)
|
Loading…
Reference in a new issue