A Discord bot search engine implemented in Python
Install requirements with:
pip install -r requirements.txt
Obtain Discord bot credentials and place in a .env file in the same directory as main.py
DISCORD_TOKEN = [copy paste token]
Run main.py
All search modules are imported from ./src
The modules each have the ability to send messages using discord.py.
Example:
- Each module is required to be hooked up to the logging system
- This can be done via:
Log.appendToLog(ctx=discord.ext.commands.Context, command=str, args=str OR list)
- The required instance attributes are:
bot=discord.ext.commands.Bot
ctx=discord.ext.commands.Context
searchQuery=str
- Optional instance attributes are:
searchSettings=dict
- The serverSettings.json (and by extension searchSettings attrib) are structured as follows:
{
guildID=int: {
"adminrole": roleID=int OR None,
"blacklist": [userID=int],
"sudoer": [userID=int],
"safesearch": bool,
"wikipedia": bool,
"scholar": bool,
"google": bool,
"mal": bool,
"youtube": bool,
"commandprefix": char
}
}