2020-02-02 23:08:15 +02:00
|
|
|
from modules.common.module import BotModule
|
|
|
|
|
|
|
|
|
|
|
|
class MatrixModule(BotModule):
|
2020-02-06 01:19:45 +02:00
|
|
|
|
2019-12-09 22:30:06 +02:00
|
|
|
async def matrix_message(self, bot, room, event):
|
2019-12-25 20:49:20 +02:00
|
|
|
msg = f'This is Hemppa {bot.version}, a generic Matrix bot. Known commands:\n\n'
|
2019-12-09 22:30:06 +02:00
|
|
|
|
|
|
|
for modulename, moduleobject in bot.modules.items():
|
2020-02-06 01:19:45 +02:00
|
|
|
if moduleobject.enabled:
|
|
|
|
msg = msg + '!' + modulename
|
|
|
|
try:
|
|
|
|
msg = msg + ' - ' + moduleobject.help() + '\n'
|
|
|
|
except AttributeError:
|
|
|
|
pass
|
2020-02-27 22:28:57 +02:00
|
|
|
msg = msg + "\nMore information at https://github.com/vranki/hemppa"
|
2019-12-09 22:30:06 +02:00
|
|
|
await bot.send_text(room, msg)
|
|
|
|
|
|
|
|
def help(self):
|
2020-02-02 23:08:15 +02:00
|
|
|
return 'Prints help on commands'
|