Remove CONVO and added mention
This commit is contained in:
parent
2ae7cbf3e9
commit
5d9dd0dc51
2
bot.py
2
bot.py
@ -45,7 +45,7 @@ intents.members = True
|
|||||||
# create the bot
|
# create the bot
|
||||||
class MyBot(commands.Bot):
|
class MyBot(commands.Bot):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(command_prefix=get_server_prefix, intents = intents)
|
super().__init__(command_prefix=commands.when_mentioned_or(get_server_prefix), intents = intents)
|
||||||
self.synced = False
|
self.synced = False
|
||||||
self.warnings = {}
|
self.warnings = {}
|
||||||
self.remove_command("help")
|
self.remove_command("help")
|
||||||
|
@ -28,6 +28,13 @@ class convo(commands.Cog):
|
|||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
print("Convo Online")
|
print("Convo Online")
|
||||||
|
|
||||||
|
@commands.hybrid_command(name="convosetup", description="Sets up a conversation channel")
|
||||||
|
@commands.has_permissions(administrator=True)
|
||||||
|
@commands.check(is_enabled)
|
||||||
|
async def convosetup(self, ctx, channel: discord.TextChannel = None):
|
||||||
|
await ctx.send("API for this command is no longer active. Convo disabled until further notice")
|
||||||
|
|
||||||
|
"""
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message):
|
async def on_message(self, message):
|
||||||
client = pymongo.MongoClient(os.getenv("mongo_url"))
|
client = pymongo.MongoClient(os.getenv("mongo_url"))
|
||||||
@ -64,26 +71,7 @@ class convo(commands.Cog):
|
|||||||
response = requests.request("GET", url, headers=headers)
|
response = requests.request("GET", url, headers=headers)
|
||||||
|
|
||||||
await channelll.send(response.json()['message'])
|
await channelll.send(response.json()['message'])
|
||||||
|
"""
|
||||||
@commands.hybrid_command(name="convosetup", description="Sets up a conversation channel")
|
|
||||||
@commands.has_permissions(administrator=True)
|
|
||||||
@commands.check(is_enabled)
|
|
||||||
async def convosetup(self, ctx, channel: discord.TextChannel = None):
|
|
||||||
client = pymongo.MongoClient(os.getenv("mongo_url"))
|
|
||||||
db = client.servers
|
|
||||||
coll = db.convo
|
|
||||||
|
|
||||||
if channel == None:
|
|
||||||
channel = ctx.channel
|
|
||||||
|
|
||||||
channell = coll.find_one({"_id": {"guild_id": ctx.guild.id}, "channel": channel.id})
|
|
||||||
|
|
||||||
if channell == None:
|
|
||||||
coll.insert_one({"_id": {"guild_id": ctx.guild.id}, "channel": channel.id})
|
|
||||||
await ctx.send("Conversation channel setup!")
|
|
||||||
|
|
||||||
else:
|
|
||||||
await ctx.send("Conversation channel is already setup!")
|
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot):
|
async def setup(bot):
|
||||||
|
Loading…
Reference in New Issue
Block a user