2 # tall.bot - a simple Discord Wikipedia bot
10 keywords = ["what is", "What is", "what was", "What was", "what were",
11 "What were", "who is", "Who is", "who was", "Who was",
12 "who were", "Who were", "who are", "Who are"]
14 def wiki_sum(search, sen, pid):
15 search = " ".join(search)
18 output = "<Wikipedia> " + wikipedia.summary(search, sentences=sen)
19 logging.info(str(pid) + " | " + search)
20 except Exception as e:
22 logging.info(str(pid) + " | " + search + " | " + str(e))
26 def keyword_check(inp):
34 class TallBot(discord.Client):
35 async def on_ready(self):
36 logging.debug('Logged in as ', self.user)
38 async def on_message(self, message):
39 if message.author == self.user:
42 if keyword_check(message.content):
43 await message.channel.send(wiki_sum(message.content.split()[2:],
48 client.run(sys.argv[1])