Skip to content

Commit

Permalink
Handle if no module found for bots (mem0ai#564)
Browse files Browse the repository at this point in the history
Co-authored-by: Taranjeet Singh <[email protected]>
  • Loading branch information
Dev-Khant and taranjeet authored Sep 12, 2023
1 parent 2cb4793 commit bdef85f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
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

0 comments on commit bdef85f

Please sign in to comment.