Skip to content

A bot for managing and browsing multiple wikis within one discord server.

License

Notifications You must be signed in to change notification settings

ramonamerong/Wikinator

Repository files navigation

Discord wiki bot: Wikinator

Description

This bot is intended for browsing multiple wikis from within a server. You can almost add all kind of wikis, ranging from a normal Wikipedia to a Gamepedia or Fandom wiki. You can then browse that wiki from within Discord using a set abbrevation.

Adding the bot to your server

An hosted version of the bot can be found at [top.gg](https://top.gg/bot/708782396023242753). Alternatively, you can host the bot yourself if you know how to do so, but be aware that this bot was created during version 11 of [DiscordJS](https://discord.js.org/). For the setup the following things are required:

  • A PostgreSQL database must first be setup according to the schema in database.psql. An example would be to first create a database with CREATE DATABASE db_name; and then load the schema with psql -U db_user db_name < database.psql;.
  • A discord bot must be created at https://discord.com/developers/applications and the token must be added to config.json > token.
  • The database host location (localhost by default), PostgreSQL username and password must be added to config.json > database
After starting the bot with node, the database is connected succesfully when the message Database connected is displayed in the console.

Slash commands

  • /help [command name]This command can be used to get a list of all commands or more info about a certain command.
  • /add [wiki abbreviation] [wiki url] [default] (This command is limited to the owner and admins of a server) Use this command to add (or update when using the same abbreviation) a wiki to this server. The provided wiki abbreviation can be used in conjunction with the /wiki command to search that wiki. The wiki url must be of the format https://example.com. You can also set the wiki as the default for the server so the abbreviation is not needed when using /wiki.
  • /remove [wiki abbreviation, name or url] (This command is limited to the owner and admins of a server) With this command you can remove a wiki from your server. You can do this by providing either the wiki's abbreviation, name or url (in the format https://example.com).
  • /wiki page/category/search/all [search] [wiki abbreviation - optional] This command can be used to search any registered wiki for info.
    Use a wiki abbreviation if you want to search for a specific wiki. You can see all wikis with '/list'. The default is the English Wikipedia.
    Use the page subcommand to search for wiki pages with the searched title;
    the category subcommand to search for matching categories and pages falling under these categories (if you enter \'all\' you will get all categories);
    or the search subcommand to search for wiki pages containing your search in their body.
    If you use the all subcommand page titles, categories and bodies will all be searched.
    Example: /wiki mc search creeper - Search a minecraft wiki for all pages containing the word 'creeper'.
  • /list Use this command to get a list of all available wikis to this server. The wiki's name and abbreviation will both be displayed.
  • /calc [arithmetic sum] Use this command to calculate a simple arithmetical sum, only containing addition '+', subtraction '-', multiplication '*', division '/' and power '^' operators. You can also enclose something in brackets '()' to indicate that that should be calculated first.
    Example: /calc (2+3) * 5

Future additions

  • Different embed colors for each added wiki.

Contact

Please open an issue on this GitHub or contact me on ramonamerong@live.nl in case you have found any bugs or if you want to provide suggestions for future additions!