This commit is contained in:
retoor 2025-02-01 16:14:08 +01:00
parent 104854be6a
commit 818aca5449
2 changed files with 3 additions and 4 deletions

View File

@ -63,7 +63,7 @@ class ExampleBot(Bot):
await self.send_message(data.channel_uid, result) await self.send_message(data.channel_uid, result)
async def on_message(self, data): async def on_message(self, data):
print(f"Message from f{data.user_nick}: {data.message}") print(f"Message from {data.user_nick}: {data.message}")
message = data.message.lower() message = data.message.lower()
result = None result = None
@ -84,6 +84,6 @@ asyncio.run(bot.run())
#### Run the bot #### Run the bot
Make sure you have (still) activated your virtual env. Make sure you have (still) activated your virtual env.
```bash ```bash
python bot.py python [your-script].py
``` ```
If you get the error 'python not found' or 'aiohttp not found', run `source .venv/bin/activate` again and run `python bot.py` again. If you get the error 'python not found' or 'aiohttp not found', run `source .venv/bin/activate` again and run `python [your script].py` again.

View File

@ -6,7 +6,6 @@ build-backend = "setuptools.build_meta"
name = "snekbot" name = "snekbot"
version = "1.0.0" version = "1.0.0"
readme = "README.md" readme = "README.md"
license = { file = "LICENSE", content-type="text/markdown" }
description = "Bot API for Snek chat" description = "Bot API for Snek chat"
authors = [ authors = [
{ name = "retoor", email = "retoor@molodetz.nl" } { name = "retoor", email = "retoor@molodetz.nl" }