- CommandRandquote cmd;
- public:
- ModuleRandQuote()
- : cmd(this)
- {
- ConfigReader conf;
- // Sort the Randomizer thingie..
- srand(ServerInstance->Time());
-
- q_file = conf.ReadValue("randquote","file",0);
- prefix = conf.ReadValue("randquote","prefix",0);
- suffix = conf.ReadValue("randquote","suffix",0);
-
- if (q_file.empty())
- {
- throw ModuleException("m_randquote: Quotefile not specified - Please check your config.");
- }
-
- quotes = new FileReader(q_file);
- if(!quotes->Exists())
- {
- throw ModuleException("m_randquote: QuoteFile not Found!! Please check your config - module will not function.");
- }
- else
- {
- /* Hidden Command -- Mode clients assume /quote sends raw data to an IRCd >:D */
- ServerInstance->AddCommand(&cmd);
- }
- Implementation eventlist[] = { I_OnUserConnect };
- ServerInstance->Modules->Attach(eventlist, this, 1);
- }