Files
OpenBB/bots/cmds/dd_cmds.py
teh_coderer 50cafd500e Discord bot massive improvement (#1481)
* allow logs feature flag

* Adding log collection md

* upload last log at startup

* additions/refractor

* refactor

* lint/black ++

* disc

* TimeRotating Logger and upload to s3

* corrected regex error

* makeup for config

* logging/disc/sia/etf/++

* append .log before uploading

* process to upload logs to s3

* candle ta/etfmcds

* fix

* ta candles

* implement presignedURL

* fixed regex

* ma's in 1 cmd, delete older files

* refactor ta candle

* updates

* black

* moon?

* Logger uploader

* rotate every hour

* only archive if successful

* chavis suggestions

* windows

* ta

* commands_dict update

* discord tacmds

* log_collection error fix

* fix

* fix

* pylint

* bb fix

* only log filesize

* fixes

* discord logs

* Delete log_collection.md

* fixes for other bots on images

* bots image upload fix

* updated helpers/load candle

* more ta cc/housekeeping/refactors/slashcmds

* update bots cmds_dict

* adjustments to font size/fixes

* test fixs/disc earnings

* missed a spot

* fixes had > revesred

* reversed the >< again oops

* remove logger branch code blocking tests

* black fix

* fix missing sources in docstr/daily candle dt tz

* load_candle refactor with docstring

* moved insiders to disc

* Lucas logging changes

* Fixing log_collection.md

* testing scenario

* more ta converted

* more ta

* Update config_terminal : remove print of verbosity

* table cfg/fix matplt/ screener +

* fix

* what's sleep? 1 more line.. or 2. scr df2img

* juan more. fix news 1m chart issue

* ticker.upper() fixes

* Update log collection

* Updating log collection - change tmp folder

Co-authored-by: LBolte29 <lbolte@gmx.net>
Co-authored-by: Chavithra PARANA <chavithra@gmail.com>
Co-authored-by: LBolte29 <97528701+LBolte29@users.noreply.github.com>
Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com>
Co-authored-by: didierlopes.eth <dro.lopes@campus.fct.unl.pt>
2022-03-16 10:21:27 +00:00

126 lines
3.5 KiB
Python

from __future__ import annotations
import disnake
from disnake.ext import commands
from bots.helpers import ShowView, ticker_autocomp
from bots.stocks.due_diligence.analyst import analyst_command
from bots.stocks.due_diligence.arktrades import arktrades_command
from bots.stocks.due_diligence.customer import customer_command
from bots.stocks.due_diligence.est import est_command
from bots.stocks.due_diligence.pt import pt_command
from bots.stocks.due_diligence.sec import sec_command
from bots.stocks.due_diligence.supplier import supplier_command
class DueDiligenceCommands(commands.Cog):
"""Due Diligence menu."""
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.slash_command(name="dd")
async def dd(self, inter):
pass
@dd.sub_command()
async def analyst(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
):
"""Displays analyst recommendations [Finviz]
Parameters
-----------
ticker: Stock Ticker
"""
await ShowView().discord(analyst_command, inter, "dd analyst", ticker)
@dd.sub_command()
async def pt(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
raw: bool = False,
start="",
):
"""Displays chart with price targets [Business Insiders]
Parameters
-----------
ticker: Stock Ticker
raw: True or false
start: YYYY-MM-DD format
"""
await ShowView().discord(pt_command, inter, "dd pt", ticker, raw, start)
@dd.sub_command()
async def est(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
):
"""Displays earning estimates [Business Insider]
Parameters
-----------
ticker: Stock Ticker
"""
await ShowView().discord(est_command, inter, "dd est", ticker)
@dd.sub_command()
async def sec(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
):
"""Displays sec filings [Market Watch]
Parameters
-----------
ticker: Stock Ticker
"""
await ShowView().discord(sec_command, inter, "dd sec", ticker)
@dd.sub_command()
async def supplier(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
):
"""Displays suppliers of the company [CSIMarket]
Parameters
-----------
ticker: Stock Ticker
"""
await ShowView().discord(supplier_command, inter, "dd supplier", ticker)
@dd.sub_command()
async def customer(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
):
"""Displays customers of the company [CSIMarket]
Parameters
-----------
ticker: Stock Ticker
"""
await ShowView().discord(customer_command, inter, "dd customer", ticker)
@dd.sub_command()
async def arktrades(
inter: disnake.AppCmdInter,
ticker: str = commands.Param(autocomplete=ticker_autocomp),
num: int = 10,
):
"""Displays trades made by ark [cathiesark.com]
Parameters
-----------
ticker: Stock Ticker
num: number of rows displayed
"""
await ShowView().discord(arktrades_command, inter, "dd arktrades", ticker, num)
def setup(bot: commands.Bot):
bot.add_cog(DueDiligenceCommands(bot))