-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove.py
More file actions
27 lines (20 loc) · 695 Bytes
/
remove.py
File metadata and controls
27 lines (20 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import requests
import sys
import time
import os
from dotenv import load_dotenv
def main():
load_dotenv()
TOKEN = os.getenv('SLACK_PRIVATE_TOKEN')
WORKSPACE = os.getenv('SLACK_WORKSPACE_NAME')
for line in iter(sys.stdin.readline, ""):
name = line.rstrip()
data = {"name": (None, name, ""), "token": (None, TOKEN, ""),
"_x_reason": (None, "customize-emoji-remove", ""), "_x_reason": (None, "customize-emoji-remove", "")}
print(name)
response = requests.post(
f'https://{WORKSPACE}.slack.com/api/emoji.remove', files=data)
print(response.json())
time.sleep(3)
if __name__ == '__main__':
main()