mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 07:05:36 +01:00
Update
This commit is contained in:
@@ -94,6 +94,8 @@ class MessageEvent(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
async def get_completion(message: str) -> str:
|
async def get_completion(message: str) -> str:
|
||||||
|
logger.info(f"Getting completion for message: {message}")
|
||||||
|
|
||||||
async with AsyncClient() as client:
|
async with AsyncClient() as client:
|
||||||
response = await client.post(
|
response = await client.post(
|
||||||
"https://openrouter.ai/api/v1/chat/completions",
|
"https://openrouter.ai/api/v1/chat/completions",
|
||||||
@@ -128,6 +130,16 @@ class MessagesProc:
|
|||||||
async def on_message(cls, event: MessageEvent):
|
async def on_message(cls, event: MessageEvent):
|
||||||
logging.info(f"Received message: {event}")
|
logging.info(f"Received message: {event}")
|
||||||
|
|
||||||
|
if "гойда" in event.message.text.lower():
|
||||||
|
twitch = await authorize()
|
||||||
|
|
||||||
|
await twitch.send_chat_message(
|
||||||
|
event.broadcaster_user_id,
|
||||||
|
config.TWITCH_ADMIN_USER_ID,
|
||||||
|
"ГООООООООООООООООООООООООООООООООООООООООООООООЙДА!",
|
||||||
|
reply_parent_message_id=event.message_id
|
||||||
|
)
|
||||||
|
|
||||||
if event.chatter_user_login in cls.IGNORED_USER_LOGINS:
|
if event.chatter_user_login in cls.IGNORED_USER_LOGINS:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -159,13 +171,3 @@ class MessagesProc:
|
|||||||
"Пошел нахуй!",
|
"Пошел нахуй!",
|
||||||
reply_parent_message_id=event.message_id
|
reply_parent_message_id=event.message_id
|
||||||
)
|
)
|
||||||
|
|
||||||
if "гойда" in event.message.text.lower():
|
|
||||||
twitch = await authorize()
|
|
||||||
|
|
||||||
await twitch.send_chat_message(
|
|
||||||
event.broadcaster_user_id,
|
|
||||||
config.TWITCH_ADMIN_USER_ID,
|
|
||||||
"ГООООООООООООООООООООООООООООООООООООООООООООООЙДА!",
|
|
||||||
reply_parent_message_id=event.message_id
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user