File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,9 +184,42 @@ actionFrameBuilder()
184184 .buildToContext();
185185```
186186
187+ ** Prefer annotations? **
188+ Alternatively , you can also use @BotMillDomain and @BotMillController to your designated method and create the reply.
189+
190+ ```java
191+ @BotMillDomain
192+ public class SampleDomain extends AbstractDomain {
193+
194+ @BotMillController (event = EventType . TEXT_MESSAGE , text = " Hello" )
195+ public void replyText () {
196+ reply(new LinkMessageReply () {
197+ @Override
198+ public LinkMessage processReply (Message message ) {
199+ return LinkMessageBuilder . getInstance(). setTitle(" Title" ). setUrl(" http://alvinjayreyes.com" ). setPicUrl(" http://pad1.whstatic.com/images/9/9b/Get-the-URL-for-Pictures-Step-2-Version-4.jpg" )
200+ .build();
201+ }
202+ });
203+ }
204+
205+ @BotMillController (event = EventType . TEXT_PATTERN , pattern = " (?i:hi)" )
206+ public void replyText1 () {
207+ reply(new LinkMessageReply () {
208+ @Override
209+ public LinkMessage processReply (Message message ) {
210+ return LinkMessageBuilder . getInstance(). setTitle(" Title1" ). setUrl(" http://alvinjayreyes.com" ). setPicUrl(" http://pad1.whstatic.com/images/9/9b/Get-the-URL-for-Pictures-Step-2-Version-4.jpg" )
211+ .build();
212+ }
213+ });
214+ }
215+ }
216+
217+ ```
218+
219+
187220** < h3> How to use it on other Java Frameworks</ h3> **
188221
189- The KikBotMillLoad class offers a set of static methods that can be accessto load Entry Points and catch WebHook URL POST Request.
222+ The KikBotMillLoad class offers a set of static methods that can be access to load Entry Points and catch WebHook URL POST Request.
190223
191224```java
192225// Call this upon initialization of your app (should only be called once)
You can’t perform that action at this time.
0 commit comments