|
@@ -2,6 +2,7 @@ from discord.ext import commands
|
|
|
import discord
|
|
import discord
|
|
|
import time
|
|
import time
|
|
|
from typing import Optional
|
|
from typing import Optional
|
|
|
|
|
+from query.channel import get_interact
|
|
|
|
|
|
|
|
def setup(bot: commands.Bot):
|
|
def setup(bot: commands.Bot):
|
|
|
bot.add_cog(General(bot))
|
|
bot.add_cog(General(bot))
|
|
@@ -51,8 +52,11 @@ class General(commands.Cog):
|
|
|
else:
|
|
else:
|
|
|
await ctx.send("What would you like me to say?")
|
|
await ctx.send("What would you like me to say?")
|
|
|
elif channel:
|
|
elif channel:
|
|
|
-
|
|
|
|
|
- await channel.send(message)
|
|
|
|
|
|
|
+ print(channel.id)
|
|
|
|
|
+ if await get_interact(self.bot.pg, channel.id): # or await ctx.author.get_guild_permissions(channel.guild):
|
|
|
|
|
+ await channel.send(message)
|
|
|
|
|
+ else:
|
|
|
|
|
+ await ctx.send(f"Interactive mode for {channel} is deactivated.")
|
|
|
elif user:
|
|
elif user:
|
|
|
await user.send(message)
|
|
await user.send(message)
|
|
|
else:
|
|
else:
|