Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending attachment/images #222

Open
BIosfdp opened this issue Nov 8, 2023 · 0 comments
Open

Sending attachment/images #222

BIosfdp opened this issue Nov 8, 2023 · 0 comments

Comments

@BIosfdp
Copy link

BIosfdp commented Nov 8, 2023

Hey, i'm a bit new to all this. Just trying to work with the basic hellobot.py

from forest.core import Bot, Message, run_bot

class HelloBot(Bot):
async def do_hello(self, _: Message) -> str:
return "Hello, world!"

if name == "main":
run_bot(HelloBot)

And trying to respond with an image instead of "Hello, world!".

I want to use a local file on desktop, but i can seem to figure out any way. If i try something like :
class HelloBot(Bot):
async def do_hello(self, : Message) -> str:
image_path = "./test_image/image.jpg"
await self.send_message(message, image_path
content_type="image/jpeg")

Or other "self.send_XXXX(anything)" it simply wont work.
Any ideas or tips, thanks in advance !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant