From 0bb92bfe7a0350759c6213f0751bb3f9ac64920b Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 16 Dec 2020 15:00:26 +0530 Subject: added a command to find title of a sauce --- bot.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 1f474b5..e54c787 100644 --- a/bot.py +++ b/bot.py @@ -2,7 +2,8 @@ import discord import os from dotenv import load_dotenv import random -# from hentai import hentai +import math +import henti as H # the good stuff greetings = ["Greetings.", "Hello.", "Hey!", "Yahallo!", "Namaskar,", "Konnichiwa,", "Yo!"] def get_info(): @@ -33,6 +34,7 @@ HELP_MESSAGE = '```Every command should be prefixed with "' + CALL + '".\n\nsay load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') +PASSWORD = os.getenv('ADMIN_PASSWORD') # this can prove to be insecure af # frontend stuff client = discord.Client() @@ -47,6 +49,7 @@ async def on_ready(): @client.event async def on_message(message): + # ignore if sent by itself if message.author == client.user: return @@ -72,4 +75,15 @@ async def on_message(message): await message.channel.send(response) +# cultured stuff +@client.event +async def on_message(message): + if message.author == client.user: + return + + if message.content.split()[0] == CALL + 'find': # find title of henti + sauce = (''.join(message.content.split()[1:])) + response = H.find_title(sauce) + await message.channel.send(response) + client.run(TOKEN) -- cgit v1.2.3