ExGram.Middleware.Builder (ex_gram v0.65.0)

Copy Markdown View Source

Macros for building bot middleware chains, commands, regex patterns, and init hooks.

This module provides a DSL for declaratively configuring bot behavior using module attributes. Use use ExGram.Middleware.Builder in your bot module to access the middleware/1-2, command/1-2, regex/2-3, and on_bot_init/1-2 macros.

At compile time, these declarations are collected and exposed via middlewares/0, commands/0, regexes/0, and bot_inits/0 functions.

See the Middlewares guide for usage examples.

Summary

Functions

command(command, opts \\ [])

(macro)

compile_regex(regex)

middleware(middleware, opts \\ [])

(macro)

on_bot_init(module, opts \\ [])

(macro)

regex(regex, name, opts \\ [])

(macro)