File tree Expand file tree Collapse file tree 4 files changed +1
-371
lines changed
Expand file tree Collapse file tree 4 files changed +1
-371
lines changed Original file line number Diff line number Diff line change 22
33from typing import TYPE_CHECKING
44
5- import asyncio
65from datetime import UTC , time , datetime
76
8- import twikit
97import aiohttp
108from telegram import InlineKeyboardButton , InlineKeyboardMarkup
119from telegram .error import TelegramError
@@ -64,24 +62,7 @@ async def _autopost_vote_reminder(self):
6462 embed .description += "\n "
6563
6664 else :
67- try :
68- async with asyncio .timeout (60 ):
69- client = twikit .Client ("en-US" )
70-
71- await client .login (
72- auth_info_1 = self .bot .config .TWITTER_USERNAME ,
73- auth_info_2 = self .bot .config .TWITTER_EMAIL ,
74- password = self .bot .config .TWITTER_PASSWORD ,
75- cookies_file = "cookies.json" ,
76- )
77-
78- user = await client .get_user_by_screen_name ("NervaCurrency" )
79- tweets = await client .get_user_tweets (user .id , "Tweets" , count = 1 )
80-
81- post_id = tweets [0 ].id
82-
83- except (TimeoutError , twikit .TwitterException ):
84- post_id = self .bot .config .FALLBACK_TWEET_ID
65+ post_id = self .bot .config .FALLBACK_TWEET_ID
8566
8667 embed .description = (
8768 f"Interact on X:\n \n https://x.com/NervaCurrency/status/{ post_id } \n \n "
Original file line number Diff line number Diff line change 2828
2929GITHUB_TOKEN = "..."
3030
31- TWITTER_USERNAME = "..."
32- TWITTER_EMAIL = "..."
33- TWITTER_PASSWORD = "..."
34-
3531FALLBACK_TWEET_ID = ...
3632
3733AUTOPOST_VOTE_REMINDER_CHANNEL_ID = ...
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ dependencies = [
1717 " motor>=3.6.0" ,
1818 " python-dateutil>=2.9.0.post0" ,
1919 " python-telegram-bot>=21.6" ,
20- " twikit>=2.3.3" ,
2120 " validators>=0.34.0" ,
2221]
2322
You can’t perform that action at this time.
0 commit comments