Wiki Utilities is a Discord bot, which allows wiki (think Fandom, Wikipedia) admins to take administrative actions, such as deleting, moving, protecting pages and more, through Discord. As Wiki Utilities requires credentials, it is a self-hosted bot, meaning you need to host it yourself to use it.
- Blocking users.
- Listing pages in a category.
- Deleting pages.
- Editing pages.
- Moving (i.e. renaming) pages.
- Modifying the protection levels of pages.
- Undeleting (i.e. restoring) pages.
- Multilingual, currently supporting English, Polish and Hindi (add more!).
- Integration with RcGcDw (see #110), allowing admins to lazily react to log messages with emojis, to either block the user, revert the edit, or delete the page.
Note: as the bot uses some newer technology, including optional chaining and private class fields, it requires at least Node.js v14. Running the bot with a version lower than this will lead to an error on startup. You will also need Git and a package manager such as pnpm installed.
-
Clone this repo to your machine by running
git clone https://github.com/Sidemen19/Wiki-Utilities.git
. -
Rename
config.sample.json
toconfig.json
. -
Go to the Discord developer's website while you are logged in to your Discord account here.
- Create a new application.
- Copy the Client ID.
- Next, add a Bot (NOTE - you need to make the bot private (meaning only you can invite it to servers), by toggling the switch).
-
Get the bot's token from the Bot page, copy it, and paste it into the value of
token
in config.json. -
Invite Wiki Utilities to a server, by going to
https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=330816
. -
Install required dependencies, using
pnpm install
ornpm install
. -
Get the bot online by running
node .
in the root directory.
All configuration options are stored in config.json.
-
token
: The token of the bot. Get this by following the above instructions. -
prefixes
: An array of all the prefixes the bot recognises. Defaults to justwu!
. -
lang
: The language you want the bot to respond with. Currently supportsen
,pl
andhi
. -
owners
: An array of all the owners of the bot. Put your Discord ID here, and any others if you want. The owners of the bot bypass all restrictions! Be careful with who you give this to. -
guilds
: The object which holds configuration data for each guild. Information on what is required here is below. -
user_map
A map of user IDs to their wiki usernames. Example of this configuration would be"441164156016787486": "Sidemen19"
. If this option is disabled or missing an ID, it will display the author's Discord tag, instead of their wiki username in edit summaries and reasons.
url
: The URL to the wiki. Example:https://community.fandom.com
path
: The path to the wiki's api.php file. For example, all Fandom wikis' path is an empty string as the file's located atc.fandom.com/api.php
, but wikipedia has/w
as their path as their api.php file is located aten.wikipedia.org/w/api.php
allowed_roles
: An array of role IDs, the members of it will be able to take administrative wiki actions. (NOTE: give this only to a trusted role, this is basically giving admin rights to whoever is in this role). Owners of the bot bypass this.blacklisted_users
: An array of user IDs, this overridesallowed_roles
, removing the right from any untrustworthy users.rcgcdw_extension
enabled
: Whether the extension is enabled or not.channel_ids
: An array of all logging channel IDs.mode
:compact
orembed
. Whether your RcGcDw script is running in compact or embed mode.wiki_name
: The name of the wiki that the RC script is running for.block_duration
: The block duration applied to the block when using the block reaction. As the system is all reaction-based, this isn't modifiable at the time of block.emojis
: Any unicode emojis to use when reacting, instead of the default regional indicators.
credentials
(these must be obtained fromSpecial:BotPasswords
)username
: The username. (it is recommended to use a separate bot account, and give that admin rights, instead of your main account).password
: The bot password. Obtain this from Special:Botpasswords.
One of Wiki Utilities' main features is its support for RcGcDw. What admins can do with this feature, is as a log entry comes through, react with an emoji, to do one of the following:
:regional_indicator_b
: Blocks the user who created/edited the page.:regional_indicator_d
: Deletes the page edited/created.:regional_indicator_r
: Reverts the edit.
The extension supports both compact and embed mode.