StephanAkkerman / fintwit-bot

FinTwit-Bot is a Discord bot designed to track and analyze financial markets by pulling data from platforms like Twitter, Reddit, and Binance. It features customizable tools for sentiment analysis, market trends, and portfolio tracking to help traders stay informed and make data-driven decisions.
http://akkerman.ai/fintwit-bot/
MIT License
76 stars 15 forks source link

it doesnt works. #594

Closed jbosolutions closed 4 months ago

jbosolutions commented 4 months ago

(base) jbosolutions@MacBook-Pro-de-Julian src % python main.py No portfolio.db found, returning empty db No assets.db found, returning empty db No tweets.db found, returning empty db No reddit_ids.db found, returning empty db No ideas_ids.db found, returning empty db No classified_tickers.db found, returning empty db No options.db found, returning empty db Loading commands ... Traceback (most recent call last): File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/main.py", line 107, in load_folder("commands") File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/main.py", line 77, in load_folder for filename in os.listdir(f"./src/cogs/{foldername}"): FileNotFoundError: [Errno 2] No such file or directory: './src/cogs/commands' (base) jbosolutions@MacBook-Pro-de-Julian src % python main.py No portfolio.db found, returning empty db No assets.db found, returning empty db No tweets.db found, returning empty db No reddit_ids.db found, returning empty db No ideas_ids.db found, returning empty db No classified_tickers.db found, returning empty db No options.db found, returning empty db Loading commands ... Traceback (most recent call last): File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/main.py", line 107, in load_folder("commands") File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/main.py", line 77, in load_folder for filename in os.listdir(f"./src/cogs/{foldername}"): FileNotFoundError: [Errno 2] No such file or directory: './src/cogs/commands' (base) jbosolutions@MacBook-Pro-de-Julian src %

jbosolutions commented 4 months ago

@StephanAkkerman

Channel named: 🏆┃top, with category ▬▬▬ 🐒 NFTs ▬▬▬ not found in guild: 12388652982174448. Creating it... Ignoring exception in on_ready Traceback (most recent call last): File "/Users/jbosolutions/miniforge3/lib/python3.10/site-packages/discord/cog.py", line 790, in _load_from_module_spec setup(self) File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/cogs/loops/nfts.py", line 303, in setup bot.add_cog(NFTS(bot)) File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/cogs/loops/nfts.py", line 35, in init self.top_channel = get_channel( File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/util/disc_util.py", line 72, in get_channel return asyncio.run(guild.create_text_channel(channel_name, category=category)) File "/Users/jbosolutions/miniforge3/lib/python3.10/asyncio/runners.py", line 33, in run raise RuntimeError( RuntimeError: asyncio.run() cannot be called from a running event loop

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/jbosolutions/miniforge3/lib/python3.10/site-packages/discord/client.py", line 400, in _run_event await coro(*args, *kwargs) File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/main.py", line 32, in on_ready load_folder("loops") File "/Users/jbosolutions/Desktop/videos/fintwit-bot/src/main.py", line 89, in load_folder bot.load_extension(f"cogs.{foldername}.{filename[:-3]}") File "/Users/jbosolutions/miniforge3/lib/python3.10/site-packages/discord/cog.py", line 912, in load_extension self._load_from_module_spec(spec, name) File "/Users/jbosolutions/miniforge3/lib/python3.10/site-packages/discord/cog.py", line 795, in _load_from_module_spec raise errors.ExtensionFailed(key, e) from e discord.errors.ExtensionFailed: Extension 'cogs.loops.nfts' raised an error: RuntimeError: asyncio.run() cannot be called from a running event loop /Users/jbosolutions/miniforge3/lib/python3.10/site-packages/discord/client.py:405: RuntimeWarning: coroutine 'Guild.create_text_channel' was never awaited await self.on_error(event_name, args, **kwargs) RuntimeWarning: Enable tracemalloc to get the object allocation traceback

StephanAkkerman commented 4 months ago

@jbosolutions Are these 2 bugs or did you manage to fix the bug related to the missing directory?

jbosolutions commented 4 months ago

I already corrected it... well, 5 hours ago I was correcting errors... the big problem is that the script does not create the channels and categories in discord... I had to create them one by one according to the console errors... and Now I've reached a point where I no longer know what's wrong... most things work... there are serious code errors I think... I'm stuck here:

C:\Users\Administrator\Desktop\fintwit-bot>python src/main.py No portfolio.db found, returning empty db No assets.db found, returning empty db No tweets.db found, returning empty db No classified_tickers.db found, returning empty db No options.db found, returning empty db Loading commands ... Loading: analyze.py Loading: earnings.py Loading: help.py Loading: portfolio.py No portfolio.db found, returning empty db Loading: sentiment.py Loading: stock.py

No tv_cfd.db found, returning empty db Loading loops ... Loading: assets.py Loading: earnings_overview.py Loading: events.py Loading: funding.py Loading: gainers.py Loading: ideas.py Loading: index.py Loading: liquidations.py Loading: losers.py Loading: reddit.py Loading: rsi_heatmap.py Loading: stocktwits.py Loading: stock_halts.py Loading: timeline.py Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. Loading: trending.py Loading: yield.py

Loading listeners ... Loading: on_member_join.py Loading: on_raw_reaction_add.py

No portfolios in the database. Unhandled exception in internal background task 'all_txt_channels'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks__init__.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 114, in all_txt_channels text_channel_names.append(channel.name.split("┃")[1])


IndexError: list index out of range
Getting tweets at 2024-07-06 23:24:45.089345...
Unhandled exception in internal background task 'post_crypto_events'.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\events.py", line 308, in post_crypto_events
    df = await self.get_crypto_calendar()
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\events.py", line 230, in get_crypto_calendar
    for row in table.find_all("tr")[2:]:  # Skip the header row
               ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'find_all'
Unhandled exception in internal background task 'crypto'.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\gainers.py", line 75, in crypto
    df = pd.DataFrame(binance_data)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 778, in __init__
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr
    return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr
    index = _extract_index(arrays)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index
    raise ValueError("If using all scalar values, you must pass an index")
ValueError: If using all scalar values, you must pass an index
Unhandled exception in internal background task 'funding'.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\funding.py", line 50, in funding
    df = pd.DataFrame(binance_data)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 778, in __init__
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr
    return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr
    index = _extract_index(arrays)
            ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index
    raise ValueError("If using all scalar values, you must pass an index")
ValueError: If using all scalar values, you must pass an index
Unhandled exception in internal background task 'get_latest_tweet'.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 144, in get_latest_tweet
    await self.on_data(tweet, update_tweet_id=True)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 186, in on_data
    await self.upload_tweet(e, category, media, user_screen_name, base_symbols)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 217, in upload_tweet
    if user_screen_name.lower() in self.text_channel_names:
                                   ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Timeline' object has no attribute 'text_channel_names'

Do you know whats the problem? thanks-
jbosolutions commented 4 months ago

binance errors and timeline.py errors i think...

StephanAkkerman commented 4 months ago

I just tested it and indeed channel creation does not seem to work. I will push a fix soon for all bugs mentioned.

StephanAkkerman commented 4 months ago

@jbosolutions please pull it again and let me know

jbosolutions commented 4 months ago

i think channels creation is fixed... but still many errors:

Creating it... Getting tweets at 2024-07-07 08:43:00.687514... Unhandled exception in internal background task 'post_crypto_events'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks__init.py", line 169, in _loop await self.coro(*args, kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\events.py", line 313, in post_crypto_events df = await self.get_crypto_calendar() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\events.py", line 228, in get_crypto_calendar for row in table.find_all("tr")[2:]: # Skip the header row ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'find_all' Unhandled exception in internal background task 'crypto'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks__init.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\gainers.py", line 61, in crypto df = pd.DataFrame(binance_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 778, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index raise ValueError("If using all scalar values, you must pass an index") ValueError: If using all scalar values, you must pass an index Error with get request for https://x.com/i/api/graphql/9EwYy8pLBOSFlEoSP2STiQ/HomeLatestTimeline. Error: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://x.com/i/api/graphql/9EwYy8pLBOSFlEoSP2STiQ/HomeLatestTimeline') Unhandled exception in internal background task 'funding'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\init__.py", line 169, in _loop await self.coro(*args, kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\funding.py", line 53, in funding df = pd.DataFrame(binance_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 778, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index raise ValueError("If using all scalar values, you must pass an index") ValueError: If using all scalar values, you must pass an index Unhandled exception in internal background task 'trending_nfts'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\init__.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\nfts.py", line 121, in trending_nfts await self.opensea_trending() File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\nfts.py", line 136, in opensea_trending value="\n".join(trending["symbol"].tolist()),


  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 4102, in __getitem__
    indexer = self.columns.get_loc(key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\indexes\range.py", line 417, in get_loc
    raise KeyError(key)
KeyError: 'symbol'
No top NFTs found for Opensea
Error with get request for https://api.nasdaq.com/api/calendar/earnings?date=2024-07-08.
Error: [WinError 121] The semaphore timeout period has expired
Unhandled exception in internal background task 'earnings'.
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\__init__.py", line 169, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\earnings_overview.py", line 130, in earnings
    earnings_dfs = await self.get_earnings_in_date_range(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\earnings_overview.py", line 63, in get_earnings_in_date_range
    df = await self.get_earnings_for_date(date)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\earnings_overview.py", line 82, in get_earnings_for_date
    df = pd.DataFrame(json["data"]["rows"])
                      ~~~~^^^^^^^^
KeyError: 'data'
jbosolutions commented 4 months ago

No portfolios in the database. Getting tweets at 2024-07-07 09:11:52.006336... Unhandled exception in internal background task 'crypto'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks__init.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\gainers.py", line 61, in crypto df = pd.DataFrame(binance_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 778, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index raise ValueError("If using all scalar values, you must pass an index") ValueError: If using all scalar values, you must pass an index Unhandled exception in internal background task 'funding'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\init.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\funding.py", line 53, in funding df = pd.DataFrame(binance_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 778, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index raise ValueError("If using all scalar values, you must pass an index") ValueError: If using all scalar values, you must pass an index Adding financials to tweet embed... Unhandled exception in internal background task 'get_latest_tweet'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ext\tasks\init__.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 150, in get_latest_tweet await self.on_data(tweet, update_tweet_id=True) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 178, in on_data e, category, base_symbols = await make_tweet_embed( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\tweet_embed.py", line 80, in make_tweet_embed e, category, base_symbols = await add_financials( ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\tweet_embed.py", line 198, in add_financials ticker_info = await classify_ticker(ticker, majority) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\ticker_classifier.py", line 190, in classify_ticker crypto_data = await get_best_guess(ticker, "crypto") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\ticker_classifier.py", line 61, in get_best_guess ) = await get_coin_info(ticker) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\cg_data.py", line 161, in get_coin_info if ticker in util.vars.cg_db["symbol"].values:


TypeError: 'NoneType' object is not subscriptable
StephanAkkerman commented 4 months ago

@jbosolutions This will take some time, I think the quickest way for you to get it working is to use python 3.10 and reinstall the requirements on that venv. I am using that version and everything goes smoothly on there

StephanAkkerman commented 4 months ago

I will adjust the readme that only 3.10 is supported until version testing is made.

jbosolutions commented 4 months ago

On Twitter... in addition to following the recommended accounts:

https://twitter.com/DeItaone

https://twitter.com/FirstSquawk

https://twitter.com/EPSGUID

https://twitter.com/eWhispers

Should something else be done?

jbosolutions commented 4 months ago

I am using that version and everything goes smoothly on there

OK PERFECT, let me try now.

StephanAkkerman commented 4 months ago

It seems most of your issues are related to pandas, I will at least add error handling for that so it does not crash the code

StephanAkkerman commented 4 months ago

On Twitter... in addition to following the recommended accounts:

https://twitter.com/DeItaone

https://twitter.com/FirstSquawk

https://twitter.com/EPSGUID

https://twitter.com/eWhispers

Should something else be done?

Yes, you should follow any accounts that you want the bot to use

jbosolutions commented 4 months ago

ok i run py 3.10 but still some errors...

No portfolios in the database. Getting tweets at 2024-07-07 09:51:58.749955... Unhandled exception in internal background task 'crypto'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\tasks__init.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\gainers.py", line 61, in crypto df = pd.DataFrame(binance_data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\frame.py", line 778, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index raise ValueError("If using all scalar values, you must pass an index") ValueError: If using all scalar values, you must pass an index Unhandled exception in internal background task 'funding'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\tasks\init.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\funding.py", line 53, in funding df = pd.DataFrame(binance_data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\frame.py", line 778, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\internals\construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\internals\construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\core\internals\construction.py", line 667, in _extract_index raise ValueError("If using all scalar values, you must pass an index") ValueError: If using all scalar values, you must pass an index Adding financials to tweet embed... Unhandled exception in internal background task 'get_latest_tweet'. Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\tasks\init__.py", line 169, in _loop await self.coro(*args, **kwargs) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 150, in get_latest_tweet await self.on_data(tweet, update_tweet_id=True) File "C:\Users\Administrator\Desktop\fintwit-bot\src\cogs\loops\timeline.py", line 178, in on_data e, category, base_symbols = await make_tweet_embed( File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\tweet_embed.py", line 80, in make_tweet_embed e, category, base_symbols = await add_financials( File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\tweet_embed.py", line 198, in add_financials ticker_info = await classify_ticker(ticker, majority) File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\ticker_classifier.py", line 190, in classify_ticker crypto_data = await get_best_guess(ticker, "crypto") File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\ticker_classifier.py", line 61, in get_best_guess ) = await get_coin_info(ticker) File "C:\Users\Administrator\Desktop\fintwit-bot\src\util\cg_data.py", line 161, in get_coin_info if ticker in util.vars.cg_db["symbol"].values: TypeError: 'NoneType' object is not subscriptable

StephanAkkerman commented 4 months ago

@jbosolutions and you did do pip install -r requirements.txt with the latest version of this repo? Or ar you using version 1.3.2?

jbosolutions commented 4 months ago

Correct, all this:

yahoo-fin==0.8.9.1 numpy==1.26.4 yfinance==0.2.40 pycoingecko==3.1.0 pandas==2.2.2 requests==2.32.3 PyYAML==6.0.1 tradingview-ta==3.3.0 aiohttp==3.9.5 asyncpraw==7.7.1 ccxt==4.3.51 transformers==4.41.1 matplotlib==3.9.0 scipy==1.13.1 brotli==1.1.0 py-cord==2.5.0 python-dotenv==1.0.1 tls-client==1.0.1 uncurl==0.0.11 yahooquery==2.3.7 nltk==3.8.1 timm==1.0.7

(requirements.txt was updated 2 weeks ago i think)

jbosolutions commented 4 months ago

I think twitter problems are fixed, I was following 200 accounts, now only 4, recommended ones But PANDAS problems still

StephanAkkerman commented 4 months ago

Where are you from if you don't mind me asking? It seems that maybe you're blocked from accessing Binance API or have to use a different API then I do.

Can you view the contents of this website: https://api.binance.com/api/v3/ticker/24hr ?

jbosolutions commented 4 months ago

Where are you from if you don't mind me asking? It seems that maybe you're blocked from accessing Binance API or have to use a different API then I do.

Can you view the contents of this website: https://api.binance.com/api/v3/ticker/24hr ?

well im using vps from UK, and you are right i have this error:

{ "code": 0, "msg": "Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error." }

what can i do?

jbosolutions commented 4 months ago

im asking to the server to change it to Hong Kong

jbosolutions commented 4 months ago

Workingl like a champ now!!!! I see some small problems but no errors.

Where can i post them? And i have some questions about the usage...

thanks

jbosolutions commented 4 months ago

IMG_6923 I can see everyone can send messages to the bot, how can I disable this?

jbosolutions commented 4 months ago

I don't know how it works, but when it hits an error, should I press enter for it to reconnect? I pressed enter and it started sending to discord again... I don't really understand how it works, isn't it automatic? Every time it reconnects, does it send to Discord again? It is perhaps a bit annoying for users, But like I say, I don't know how it works.

Sin título

StephanAkkerman commented 4 months ago

Workingl like a champ now!!!! I see some small problems but no errors.

Where can i post them? And i have some questions about the usage...

thanks

You can keep posting it in here, I will keep this issue open for now

StephanAkkerman commented 4 months ago

I don't know how it works, but when it hits an error, should I press enter for it to reconnect? I pressed enter and it started sending to discord again... I don't really understand how it works, isn't it automatic? Every time it reconnects, does it send to Discord again? It is perhaps a bit annoying for users, But like I say, I don't know how it works.

It should never crash, unless there is an uncaught error. I made it so that all known errors / warnings do not crash the bot, only errors that are new will do so. This is so that I am aware of new errors and can try and fix them.

You do not need to do anything manually, except if the bot gets stuck on a new error. You can press CTRL + C and restart the bot using python.

StephanAkkerman commented 4 months ago

I can see everyone can send messages to the bot, how can I disable this?

I do not have anything for configuration for that at the moment, I will create an issue for it.