Telegram Module
Telegram Module is a class inherit from TelegramModule
Used to define Handlers
Context
Module has Context field with current client, update object, command and args strings
Other fields in Api Rerefence
Methods
To reply to chat from which came current event you can use
@TelegramModularFramework.Modules.TelegramModule.ReplyAsync
To change current chat state there are @TelegramModularFramework.Modules.TelegramModule.ChangeState medhod
Other methods in Api Rerefence
Groups
Warning
In development. Commands and actions don't respect groups
To group your Handlers you can nest modeles with GroupAttribute
public class SampleStates: TelegramModule
{
[Group("sample")]
public class SampleGroup: TelegramModule
{
[Group("test")]
public class TestGroup: TelegramModule
{
}
}
}
Group field for TestGroup
is /sample/test
Dependency Injection
All Modules has DI support
For more see Dependency Injection guide