As the title says. Article for Article ⑥ written here. When I wanted to mention to multiple people, I thought about what to do and executed it as follows.
I want to mention multiple people like the red frame.
Notification destination: Notation
@user:<@user>
Since this is a user, use " user ":" U012YTNNPB5 "
**. ** (available at slack apiʻusers.list) Note that it is not
" real_name ":" test_1 "`.
menber = ['U012JDYRD2T', 'U012X478FNZ']
tmptmp = []
for i in menber:
tmptmp.append("<@" + i + ">")
r = map(str,tmptmp)
mojiretsu = ' '.join(r)
text = mojiretsu + "If you go to work, please stamp according to your status! !!"
① Since it must be in the form of <@user>
, take out [member] one by one and substitute it for [i]. Add a string " <@ "
etc. to it.
(2) Since it is written as [map (str, tmptmp)]
, use the str () function for all the elements in the list tmptmp.
③ Add '''. Join
(half-width underspace) to the list of character strings.
④ Post using this text.
I had a hard time getting the real_name
, but I didn't use it in the end.
You need to know in advance what to use and how to use the endpoint path parameters.
Recommended Posts