This commit is contained in:
parent
b0ca144fde
commit
f0fb5e8c2e
27
bot.py
27
bot.py
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user