ExGram.Middleware.IgnoreUsername (ex_gram v0.65.0)

Copy Markdown View Source

Middleware that strips the bot username from commands.

Transforms /command@bot_username to /command before the message is handled. This is useful when your bot is used in group chats where commands may be explicitly targeted at your bot to avoid ambiguity with other bots.

Example

defmodule MyBot do
  use ExGram.Bot, name: :my_bot

  middleware ExGram.Middleware.IgnoreUsername
end

See the Middlewares guide for more details.

Summary

Functions

Callback implementation for ExGram.Middleware.call/2.

Callback implementation for ExGram.Middleware.init/1.

Functions

call(cnt, arg2)

Callback implementation for ExGram.Middleware.call/2.

init(opts)

Callback implementation for ExGram.Middleware.init/1.