import niobot import textwrap with open("rust.txt") as copypasta_fd: COPYPASTA = textwrap.dedent(copypasta_fd.read()) class RustModule(niobot.Module): @niobot.event("message") async def on_message(self, room: niobot.MatrixRoom, event: niobot.RoomMessage): if not isinstance(event, niobot.RoomMessageText): return elif room.display_name != "rust": return if "rust" in event.body.lower(): await self.bot.send_message(room, COPYPASTA, message_type="m.notice")