@@ -144,7 +144,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
144144 first_arg_name = required_arg_names[0]
145145 if first_arg_name in {"self", "cls"}:
146146 required_arg_names.pop(0)
147- elif first_arg_name not in all_available_args.keys():
147+ elif first_arg_name not in all_available_args.keys() and first_arg_name != "args" :
148148 if this_func is None:
149149 logger.warning(warning_skip_uncommon_arg_name(first_arg_name))
150150 required_arg_names.pop(0)
@@ -161,7 +161,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
161161 else:
162162 logger.warning(f"Unknown Request object type detected ({type(request)})")
163163
164- if name not in found_arg_names:
164+ elif name not in found_arg_names:
165165 logger.warning(f"{name} is not a valid argument")
166166 kwargs[name] = None
167167 return kwargs</ code > </ pre >
@@ -189,6 +189,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
189189 trigger_id=body["trigger_id"],
190190 view={ ... }
191191 )
192+ </ code > </ pre >
193+ < p > Alternatively, you can include a parameter named < code > < a title ="slack_bolt.kwargs_injection.args " href ="args.html "> slack_bolt.kwargs_injection.args</ a > </ code > and it will be injected with an instance of this class.</ p >
194+ < pre > < code > @app.action("link_button")
195+ def handle_buttons(args):
196+ args.logger.info(f"request body: {args.body}")
197+ args.ack()
198+ if args.context.channel_id is not None:
199+ args.respond("Hi!")
200+ args.client.views_open(
201+ trigger_id=args.body["trigger_id"],
202+ view={ ... }
203+ )
192204</ code > </ pre > </ div >
193205< details class ="source ">
194206< summary >
@@ -209,6 +221,19 @@ <h2 class="section-title" id="header-classes">Classes</h2>
209221 view={ ... }
210222 )
211223
224+ Alternatively, you can include a parameter named `args` and it will be injected with an instance of this class.
225+
226+ @app.action("link_button")
227+ def handle_buttons(args):
228+ args.logger.info(f"request body: {args.body}")
229+ args.ack()
230+ if args.context.channel_id is not None:
231+ args.respond("Hi!")
232+ args.client.views_open(
233+ trigger_id=args.body["trigger_id"],
234+ view={ ... }
235+ )
236+
212237 """
213238
214239 client: WebClient
0 commit comments