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

Handle if no module found for bots #564

Merged
merged 7 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions embedchain/bots/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
import logging
import os

import discord
from discord import app_commands
from discord.ext import commands

from embedchain.helper.json_serializable import register_deserializable

from .base import BaseBot

try:
import discord
from discord import app_commands
from discord.ext import commands
except ModuleNotFoundError:
raise ModuleNotFoundError(
"The required dependencies for Discord are not installed."
'Please install with `pip install "embedchain[discord]"`'
) from None


intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
Expand Down
9 changes: 7 additions & 2 deletions embedchain/bots/poe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
import os
from typing import List, Optional

from fastapi_poe import PoeBot, run

from embedchain.helper.json_serializable import register_deserializable

from .base import BaseBot

try:
from fastapi_poe import PoeBot, run
except ModuleNotFoundError:
raise ModuleNotFoundError(
"The required dependencies for Poe are not installed." 'Please install with `pip install "embedchain[poe]"`'
) from None


def start_command():
parser = argparse.ArgumentParser(description="EmbedChain PoeBot command line interface")
Expand Down