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

This commit is contained in:
2016-10-22 18:30:28 +00:00
parent 4b73034114
commit 8bbb661966
10 changed files with 1 additions and 1 deletions

47
telegram_bot/execbot.h Normal file
View File

@@ -0,0 +1,47 @@
#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);
void saveFile(TelegramBotAPI::File fl);
signals:
};
#endif // EXECBOT_H