bot updates
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
abs3nt 2023-01-27 12:43:27 -08:00
parent b0ca144fde
commit f0fb5e8c2e
1 changed files with 27 additions and 0 deletions

27
bot.py
View File

@ -40,6 +40,33 @@ class LMGTFY(discord.ui.View):
bot = LMGTFYBot()
@bot.event
async def on_message(message: discord.Message):
if message.author == bot.user:
return
if message.reference is None:
if message.content.startswith("!lmgtfy"):
if len(message.content.split()) > 1:
await message.reply('I will do it for you :)', view=LMGTFY(
message.content.split(' ', 1)[1])
)
return
if "google it" in message.content.lower():
if message.reference.message_id is None:
return
repl = await message.channel.fetch_message(
message.reference.message_id
)
await repl.reply('I will do it for you :)', view=LMGTFY(repl.content))
if message.content == "!lmgtfy":
if message.reference.message_id is None:
return
repl = await message.channel.fetch_message(
message.reference.message_id
)
await repl.reply('I will do it for you :)', view=LMGTFY(repl.content))
@bot.command()
async def lmgtfy(ctx: commands.Context, search: str | None):
if search is None: