mirror of
https://github.com/alterware/aw-bot.git
synced 2025-12-11 12:07:50 +00:00
fix: missing await
This commit is contained in:
@@ -64,6 +64,9 @@ async def handle_bot_mention(message, bot, no_context=False):
|
|||||||
|
|
||||||
# Check if the message is in an allowed channel
|
# Check if the message is in an allowed channel
|
||||||
if message.channel.id not in ALLOWED_CHANNELS:
|
if message.channel.id not in ALLOWED_CHANNELS:
|
||||||
|
logger.debug(
|
||||||
|
f"User {message.author} attempted to use AI in non-allowed channel: {message.channel.name}"
|
||||||
|
)
|
||||||
await message.reply(
|
await message.reply(
|
||||||
"The AI cannot used in this channel.",
|
"The AI cannot used in this channel.",
|
||||||
mention_author=True,
|
mention_author=True,
|
||||||
@@ -71,8 +74,13 @@ async def handle_bot_mention(message, bot, no_context=False):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
if is_user_blacklisted(message.author.id):
|
if is_user_blacklisted(message.author.id):
|
||||||
message.reply(
|
logger.warning(
|
||||||
"You are blacklisted from using this command.", mention_author=True
|
f"Blacklisted user {message.author} (ID: {message.author.id}) attempted to use AI"
|
||||||
|
)
|
||||||
|
await message.reply(
|
||||||
|
"**Time Travel Required!**\n"
|
||||||
|
"You'll gain access to this feature on **August 12th, 2036**.\n",
|
||||||
|
mention_author=True,
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -80,9 +80,9 @@ async def timeout_member(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Debug: Print the member object and timeout duration
|
# Debug: Print the member object and timeout duration
|
||||||
logger.debug(f"Debug: Attempting to timeout member {member} (ID: {member.id}).")
|
logger.debug(f"Attempting to timeout member {member} (ID: {member.id}).")
|
||||||
logger.debug(f"Debug: Timeout duration set to {duration}.")
|
logger.debug(f"Timeout duration set to {duration}.")
|
||||||
logger.debug(f"Debug: Reason: {reason}")
|
logger.debug(f"Reason: {reason}")
|
||||||
|
|
||||||
await member.timeout(duration, reason=reason)
|
await member.timeout(duration, reason=reason)
|
||||||
logger.info(f"Successfully timed out {member}.")
|
logger.info(f"Successfully timed out {member}.")
|
||||||
|
|||||||
Reference in New Issue
Block a user