#include <QtCore>
int main(int argc, char* argv[])
{
qputenv("IRC_DEBUG", "1");
IrcBot bot;
bot.setHost("irc.freenode.net");
bot.setUserName("communi");
bot.setRealName(
"Communi " +
Irc::version() +
" example bot");
bool joined = false;
for (
int i = 0; i < args.
count(); ++i) {
if (arg == "-help") {
qDebug() << "Usage:" << argv[0] << "(-host <host>) (-port <port>) (-ssl) (-nick <nick>) (-user <user>) (-password <password>) (-channel <channel>)";
return 0;
} else if (arg == "-port") {
bool ok = false;
int port = args.
value(++i).toInt(&ok);
if (ok)
bot.setPort(port);
} else if (arg == "-ssl") {
bot.setSecure(true);
} else if (arg == "-host") {
bot.setHost(args.
value(++i));
} else if (arg == "-user") {
bot.setUserName(args.
value(++i));
} else if (arg == "-password") {
bot.setPassword(args.
value(++i));
} else if (arg == "-nick") {
bot.setNickName(args.
value(++i));
} else if (arg == "-channel") {
bot.join(args.
value(++i));
joined = true;
}
}
if (!joined)
bot.join("#communi");
bot.open();
return app.exec();
}