mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
Update code.py
This commit is contained in:
@@ -165,6 +165,8 @@ async def help(ctx):
|
||||
embed.add_field(name="/delete", value="Delete all your data from our server", inline=False)
|
||||
embed.add_field(name="/cancel", value="Cancel the last message sent by the bot", inline=False)
|
||||
embed.add_field(name="/default", value="Set the advanced settings to their default values", inline=False)
|
||||
# embed.add_field(name="/help", value="Show this message", inline=False)
|
||||
|
||||
embed.add_field(name="/help", value="Show this message", inline=False)
|
||||
await ctx.respond(embed=embed, ephemeral=True)
|
||||
#when a message is sent into a channel check if the guild is in the database and if the bot is enabled
|
||||
@@ -244,6 +246,11 @@ async def on_message(message):
|
||||
messages = await message.channel.history(limit=prompt_size).flatten()
|
||||
messages.reverse()
|
||||
prompt = ""
|
||||
#get the channel id from the database
|
||||
c.execute("SELECT channel_id FROM data WHERE guild_id = ?", (message.guild.id,))
|
||||
if str(message.channel.id) != str(c.fetchone()[0]):
|
||||
prompt = msg.author.display_name + ":" + message.content + "\n"
|
||||
else:
|
||||
for msg in messages:
|
||||
if msg.author.bot:
|
||||
prompt += f"Botator: {msg.content}\n"
|
||||
|
||||
Reference in New Issue
Block a user