Skip to content

Commit

Permalink
turn on again
Browse files Browse the repository at this point in the history
  • Loading branch information
genekogan committed Jun 5, 2024
1 parent e870644 commit 267566f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 11 additions & 5 deletions src/cogs/Eden2Cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
EdenConfig,
)

ALLOWED_CHANNELS = [int(c) for c in os.getenv("ALLOWED_CHANNELS", "").split(",")]
# ALLOWED_CHANNELS = [int(c) for c in os.getenv("ALLOWED_CHANNELS", "").split(",")]
EDEN_CHARACTER_ID = os.getenv("EDEN_CHARACTER_ID")

client = EdenClient()
client.api_key = "2e4c65fb98622ca2aec8dae6ff07aae2eec3300aeab890e5"
print(client.api_url)
thread_id = None
thread_id = "665161a77df49de2c24fc225"

import asyncio

Expand All @@ -48,15 +48,21 @@ def __init__(

@commands.Cog.listener("on_message")
async def on_message(self, message: discord.Message) -> None:
print("ok???")
print("ON MESSAGE", message.content)
if (
message.channel.id not in ALLOWED_CHANNELS
or message.author.id == self.bot.user.id
# message.channel.id not in ALLOWED_CHANNELS
#or message.author.id == self.bot.user.id
message.author.id == self.bot.user.id
or message.author.bot
):
return

if message.channel.id != 1186378591118839808:
trigger_reply = is_mentioned(message, self.bot.user)
if not trigger_reply:
return

if message.channel.id != 1186378591118839808 and message.channel.id != 1006143747588898849:
return

global thread_id
Expand Down
4 changes: 0 additions & 4 deletions src/common/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def is_mentioned(message: discord.Message, user: discord.User) -> bool:
:param user: The user to check.
:return: True if the user is mentioned, False otherwise.
"""
print("--======")
print(message)
print(message.content)
print("mentions", [m.id for m in message.mentions], "---", user.id)
return user.id in [m.id for m in message.mentions]


Expand Down

0 comments on commit 267566f

Please sign in to comment.