Echo chat bot creatred as requested by MetaLamp. Implemented for TG and VK.
- Download and install
stack
as described here. - Clone this repository as described here or with
git clone https://github.com/alleksandrgall/metalampBot
command if you havegit
installed. - To run app you need your own Telegram bot token, which you can get here and/or VK access token and group id,details on setting up you VK group with chat bot can be found here. VK Long Poll API version is 5.131.
- Rename
config/config_template.properties
toconfig/bot.properties
, that will be an actuall config where the programm will read from. Inconfig/config_template.properties
you can also find information about additional configurations. - Place information you got on step (3) in corresponding fields in
config/bot.properties
. stack setup
for downloading compiler,stack build
for building app and downloading dependencies.stack exec metaLampBot-exe
for running your bot.
You can run tests of logic with stack test
.
app/Main.hs
- Parses config, runs an appropriate bot implementation.src/Handlers/
- Contains logic for bot and logger.src/Logger/
- Contains implementaion for logger.src/Bot/
- Contains differend bot implementations with following structer:ImplName/Implement.hs
- All functions need for bot logic to work (getUpdates
,sendMes
, ...).ImplName/Types.hs
- Types for different responses and JSON instances for them usingaeson
package.
src/Exceptions/
- Mostly educational hierchy of exception types, for web exceptions and parse exceptions.src/Internal/
- Commonly used functions and types, mainly Http connection and parsing functions inReq.hs
.src/Config.hs/
- Type for app's config and tools for parsing it provided byconferer
package.