Skip to content

muhammedaksam/WikipediaAnswerBot

 
 

Repository files navigation

VikipediBot

u/VikipediBot botu Public Repo

Tools

Language: Python

Libraries:


How it works

1. It looks through all the new comments on Reddit in real time using praw.
2. Checks whether a comment contains a question written with one of the following patterns:
  • What is / What's / What are X?
  • Who is/ Who's / Who are X?
  • What does X mean?

X is a word / phrase which meanig the comment's author wants to know

Note: If you want the bot to reply to your question, there is no need to write its name, use some specific charcter, etc. You should only ask a question the way it matches these patterns above P.S. I know that the fact you don't have to summon it is bad. But it is also good xD :)

3. Looks for an approptiate article in Wikipedia
4. Replies with a definition found in the article (if the article itself was found)

Here is an example of the bot's reply:

Note: There may be not any artcles matching some exact word or the Wikipedia API is not able to find them for some reason. If this happens, you will just not get a reply.

Also, some words may have a few meanings. In this case, the bot will respond to your comment with a link leading to other links, each of those will contain every separate definiton of an ambiguos word.

Possible irrelevant answers

You may get an answer which is completely inappropriate to the conversation. This is because the bot can not understand a whole point of the specific comment or even dialog, unfortunately ):

Additional features

  1. It writes a felicitation in the end of the comment if it is one of the following holidays today:
    • Christmas (Catholic)
    • New Year's Eve
    • New Year
    • Halloween
  2. You can opt out by using the command wab opt out and opt back in with wab opt in (wab stands for wikipedia answer bot)
  3. You can delete the comment if it has 3 or more downvotes. Command: wab delete
  4. There is one joke I don't want to reveal, hehe (you can actually find it in the code)

Hosting info:

Hosted on: Heroku

Running since: October, 2020 (I was using another private repo while hosting it)

P.S. @federicotorrielli has been hosting it for a few months and took part in the bot's development

Links

Bot: https://www.reddit.com/user/wikipedia_answer_bot

Bot's subreddit: https://www.reddit.com/r/wikipedia_answer_bot

Conclusion

Thank you for visiting this repo! Hopefully you liked it :)

Always feel free to contribute. Let's make this open source world better ;)

About

Public repo of the u/VikipediBot bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Procfile 0.2%