Skip to content

onStop

This hook is called when the bot is stopped.

Parameters

ts
{
		plugins: string[];
		info: TelegramUser;
}
  • plugins - list of plugins
  • info - bot account info

Example

ts
import { 
Bot
} from "gramio";
const
bot
= new
Bot
(
process
.
env
.
BOT_TOKEN
as string).
onStop
(
({
plugins
,
info
}) => {
console
.
log
(`plugin list - ${
plugins
.
join
(", ")}`);
console
.
log
(`bot username @${
info
.
username
}`);
} );
bot
.
start
();
bot
.
stop
();