forked from blizzthewolf/SeaCogs
fix(pterodactyl): only check if a message is a chat message if it isn't a server message
This commit is contained in:
parent
1263f59cee
commit
3e18894bb5
1 changed files with 9 additions and 8 deletions
|
@ -57,6 +57,13 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None:
|
||||||
for page in pagified_content:
|
for page in pagified_content:
|
||||||
await channel.send(content=page)
|
await channel.send(content=page)
|
||||||
|
|
||||||
|
server_message = await check_if_server_message(content)
|
||||||
|
if server_message:
|
||||||
|
channel = coginstance.bot.get_channel(await config.chat_channel())
|
||||||
|
if channel is not None:
|
||||||
|
await channel.send(server_message if len(server_message) < 2000 else server_message[:1997] + '...', allowed_mentions=discord.AllowedMentions.none())
|
||||||
|
|
||||||
|
else:
|
||||||
chat_message = await check_if_chat_message(content)
|
chat_message = await check_if_chat_message(content)
|
||||||
if chat_message:
|
if chat_message:
|
||||||
info = await get_info(chat_message['username'])
|
info = await get_info(chat_message['username'])
|
||||||
|
@ -65,12 +72,6 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None:
|
||||||
else:
|
else:
|
||||||
await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], 'https://seafsh.cc/u/j3AzqQ.png')
|
await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], 'https://seafsh.cc/u/j3AzqQ.png')
|
||||||
|
|
||||||
server_message = await check_if_server_message(content)
|
|
||||||
if server_message:
|
|
||||||
channel = coginstance.bot.get_channel(await config.chat_channel())
|
|
||||||
if channel is not None:
|
|
||||||
await channel.send(server_message if len(server_message) < 2000 else server_message[:1997] + '...', allowed_mentions=discord.AllowedMentions.none())
|
|
||||||
|
|
||||||
join_message = await check_if_join_message(content)
|
join_message = await check_if_join_message(content)
|
||||||
if join_message:
|
if join_message:
|
||||||
channel = coginstance.bot.get_channel(await config.chat_channel())
|
channel = coginstance.bot.get_channel(await config.chat_channel())
|
||||||
|
|
Loading…
Reference in a new issue