Mingel / JishoBot

Discord Bot written in Python for looking up English/Japanese translations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JishoBot

JishoBot is a basic Discord bot made in Python, which uses the jisho.org API and allows you to look up English/Japanese translations.

image

Build

The bot is built with Python. It has been tested with Python 3.7+.

To run the bot, it is required to use a Discord bot token to set up the bot. To receive a token, do the following:

  1. Go to the Applications tab in the Discord Developer portal (click here). You are required to login to your Discord account.
  2. Click New Application, insert a name for the bot, then click Create.
  3. On the left, click Bot and in the Build-A-Bot section on the right, click Add Bot and after that, Yes, do it!.
  4. Press Click to Reveal Token. Now the token is visible and can be copied.

DO NOT SHARE THE TOKEN.

Inside the root folder, a file named .env must be created. You can use the given .env.template file. Insert the discord token inside the .env file: DISCORD_TOKEN=<your token>.

Make sure that the required packages are installed:

pip install -r requirements.txt

To run the bot:

python bot.py

Or if you have Python 2 and 3 installed:

python3 bot.py

Commands

Basic:

-s <query> [-p <page>] [-d]

Search for results with the given query. Note that jisho.org will also look for results where the latin letters are converted to kana. If your query is longer than one word, you can wrap the query with quotation marks (e.g. "to eat").

-t <query> [-p <page>] [-d]

Search for results with the given query. The query will not be converted to kana if it only contains latin letters. If your query is longer than one word, you can wrap the query with quotation marks.

Extra parameters:

[-d]: Show more information about results, e.g. frequency, JLPT level and many more.

[-p <page>]: Go to a specified page.

Credits

Thanks to the team from jisho.org for making this possible!

Jisho.org uses several data sources, which can be found at jisho.org's About Page.

About

Discord Bot written in Python for looking up English/Japanese translations


Languages

Language:Python 100.0%