def channels_create(self):
os.system("clear")
fields = ["name", "purpose(OPTINAL)", "send invite"]
for i in fields:
if i == "name":
name = raw_input("\u001b[1m\u001b[31m channel name -> \u001b[0m")
elif i == "purpose(OPTINAL)":
purpose = raw_input("\u001b[1m\u001b[31m purpose of the channel(OPTINAL) : \u001b[0m")
else:
invites = prompt("send invites -> ", completer=WordCompleter(users),
style=DocumentStyle)
url = "https://slack.com/api/channels.create?token={token}&name={name}&purpose={purpose}".format(
token=settings.token,
name=name,
purpose=purpose)
response = requests.get(url).json()
# TODO : send channel and user_id to channels_invite
if response["ok"]:
os.system("figlet 'Created' | lolcat")
time.sleep(2)
os.system("clear")
评论列表
文章目录