git-svn-id: svn://db.shs.com.ru/libs@129 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2016-10-19 13:20:53 +00:00
parent 81f9c82679
commit 724d9652bd
14 changed files with 2023 additions and 0 deletions

46
telegram_test/execbot.h Normal file
View File

@@ -0,0 +1,46 @@
#ifndef EXECBOT_H
#define EXECBOT_H
#include "telegrambotbase.h"
#include <QProcess>
class ExecBot : public TelegramBotBase
{
Q_OBJECT
public:
explicit ExecBot(QObject *parent = 0);
public slots:
private:
enum UserState {
NotLogged,
Password,
Ready,
CommandExec
};
struct UserCommand {
uint user;
QProcess * cmd;
};
virtual QString loginMessage(uint id);
virtual QString help();
virtual bool loginUser(uint id, const QString & msg);
virtual void messageFromUser(uint id, const QString & msg);
void runCMD(UserCommand uc);
QMap<uint, UserState> sessions;
QVector<ExecBot::UserCommand> run_commands;
private slots:
void cmdRead();
void cmdFinish(int code);
signals:
};
#endif // EXECBOT_H