Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daef039ce5 | ||
|
|
7ad4c4052e | ||
|
|
641dc72738 |
@@ -191,7 +191,7 @@ class FlanaBot(MultiBot, ABC):
|
||||
return flanautils.chunks(buttons_texts, 3)
|
||||
|
||||
@return_if_first_empty(exclude_self_types='FlanaBot', globals_=globals())
|
||||
async def _manage_exceptions(self, exceptions: BaseException | Iterable[BaseException], message: Message):
|
||||
async def _manage_exceptions(self, exceptions: BaseException | Iterable[BaseException], context: Chat | Message):
|
||||
if not isinstance(exceptions, Iterable):
|
||||
exceptions = (exceptions,)
|
||||
|
||||
@@ -199,15 +199,15 @@ class FlanaBot(MultiBot, ABC):
|
||||
try:
|
||||
raise exception
|
||||
except BadRoleError as e:
|
||||
await self.send_error(f'Rol no encontrado en {e}', message)
|
||||
await self.send_error(f'Rol no encontrado en {e}', context)
|
||||
except InstagramLoginError as e:
|
||||
await self.send_error(f'No me puedo loguear en Instagram {random.choice(multibot_constants.SAD_EMOJIS)} 👉 {e}', message)
|
||||
await self.send_error(f'No me puedo loguear en Instagram {random.choice(multibot_constants.SAD_EMOJIS)} 👉 {e}', context)
|
||||
except MediaNotFoundError as e:
|
||||
await self.send_error(f'No he podido sacar nada de {e.source} {random.choice(multibot_constants.SAD_EMOJIS)}', message)
|
||||
await self.send_error(f'No he podido sacar nada de {e.source} {random.choice(multibot_constants.SAD_EMOJIS)}', context)
|
||||
except PlaceNotFoundError as e:
|
||||
await self.send_error(f'No he podido encontrar "{e}" {random.choice(multibot_constants.SAD_EMOJIS)}', message)
|
||||
await self.send_error(f'No he podido encontrar "{e}" {random.choice(multibot_constants.SAD_EMOJIS)}', context)
|
||||
except Exception as e:
|
||||
await super()._manage_exceptions(e, message)
|
||||
await super()._manage_exceptions(e, context)
|
||||
|
||||
@staticmethod
|
||||
def _medias_sended_info(medias: Iterable[Media]) -> str:
|
||||
@@ -343,12 +343,6 @@ class FlanaBot(MultiBot, ABC):
|
||||
@group
|
||||
@bot_mentioned
|
||||
async def _on_config_list_show(self, message: Message):
|
||||
# config_info = pprint.pformat(message.chat.config)
|
||||
# config_info = flanautils.translate(config_info, {'{': None, '}': None, ',': None, 'True': '', "'": None, 'False': '❌'})
|
||||
# config_info = config_info.splitlines()
|
||||
# config_info = '\n'.join(config_info_.strip() for config_info_ in config_info)
|
||||
# await self.send(f'<b>Estos son los ajustes del grupo:</b>\n\n<code>{config_info}</code>', message)
|
||||
|
||||
await self.send('<b>Estos son los ajustes del grupo:</b>\n\n', self._get_config_buttons(message), message)
|
||||
|
||||
async def _on_covid_chart(self, message: Message): # todo2
|
||||
|
||||
@@ -5,7 +5,6 @@ import flanautils
|
||||
os.environ |= flanautils.find_environment_variables('../.env')
|
||||
|
||||
import asyncio
|
||||
from multibot import TwitchBot
|
||||
from flanabot.bots.flana_disc_bot import FlanaDiscBot
|
||||
from flanabot.bots.flana_tele_bot import FlanaTeleBot
|
||||
|
||||
@@ -13,24 +12,10 @@ from flanabot.bots.flana_tele_bot import FlanaTeleBot
|
||||
async def main():
|
||||
flana_disc_bot = FlanaDiscBot()
|
||||
flana_tele_bot = FlanaTeleBot()
|
||||
t = TwitchBot(
|
||||
bot_token=os.environ['TWITCH_ACCESS_TOKEN'],
|
||||
initial_channels=['flanaganvaquero'],
|
||||
owner_name='flanaganvaquero'
|
||||
)
|
||||
|
||||
@t.register(always=True)
|
||||
async def asd(message):
|
||||
await t.send('@flanaganvaquero adios', message, reply_to=message)
|
||||
# await message.chat.original_object._ws.reply(message.id, f"PRIVMSG #{message.author.name.lower()} :awdwhkajwd\r\n")
|
||||
# await message.original_object.channel.reply('asd')
|
||||
# m = await t.send('hola', message, reply_to=message.id)
|
||||
# await t.send('me respondo a mi mismo', message, reply_to=m)
|
||||
|
||||
await asyncio.gather(
|
||||
flana_disc_bot.start(),
|
||||
flana_tele_bot.start(),
|
||||
t.start()
|
||||
flana_tele_bot.start()
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
aiohttp==3.7.4.post0
|
||||
aiohttp==3.8.1
|
||||
aiosignal==1.2.0
|
||||
anyio==3.5.0
|
||||
asgiref==3.4.1
|
||||
async-generator==1.10
|
||||
async-timeout==3.0.1
|
||||
async-timeout==4.0.2
|
||||
attrs==21.4.0
|
||||
beautifulsoup4==4.10.0
|
||||
certifi==2021.10.8
|
||||
@@ -14,7 +14,7 @@ click==8.0.3
|
||||
colorama==0.4.4
|
||||
cryptg==0.2.post4
|
||||
cryptography==36.0.1
|
||||
discord.py==2.0.0a4269+gb7e25645
|
||||
discord.py @ git+https://github.com/Rapptz/discord.py@b7e25645dc68bbb828bf1ede711d098c6b183237
|
||||
fastapi==0.71.0
|
||||
flanaapis
|
||||
flanautils
|
||||
@@ -47,6 +47,7 @@ selenium-stealth==1.0.6
|
||||
six==1.16.0
|
||||
sniffio==1.2.0
|
||||
sortedcontainers==2.4.0
|
||||
soupsieve==2.3.1
|
||||
starlette==0.17.1
|
||||
sympy==1.9
|
||||
Telethon==1.24.0
|
||||
|
||||
Reference in New Issue
Block a user