Skip to content

Plant ID Bot identifies plants from photos of their organs, passing to the Plantnet API for identification.

Notifications You must be signed in to change notification settings

TheRealOwenRees/plantID_discordbot

Repository files navigation

Plant ID Bot

A plant identification bot for your Discord server.

Plant ID Bot identifies plants from photos of their organs, passing to the Plantnet API for identification. This bot was written for Sustainable Living Hub

If you wish to invite this bot to your server, use this link. However, your server will be limited to a maximum of 20 idendifications every 24h. It is strongly preferred that you host a version of this bot yourself and register for your own PlantNet API key. Details for this are later in this readme file.

Features

  • Takes the message picture attachments and attempts to identify them
  • Returns a suggested plant name and up to 2 alternatives, with a percentage confidence rating
  • Plant names are given in latin with a list of possible common names
  • Provides links to GBIF and PFAF for the identified plant

Prerequisites

Plant ID Bot uses a small number of prerequisites in order to work properly:

  • Pycord - a modern, easy to use, feature-rich, and async ready API wrapper for Discord, written in Python
  • Beautiful Soup - a python library for pulling data out of HTML and XML files
  • python-dotenv - for reading local .env files during development

Installation

To add the Plant ID bot from this repository to your discord server, use this invite.

If you fork this repository and wish to host your own version of this bot, you will need to:

  • Create a new account at Plantnet API.
  • Create a new application and bot at the Discord Developer Portal. Follow this guide if you are unsure.
  • Create a local .env file to store DISCORD_TOKEN and PLANTNET_API_KEY. Add both your bot's secret token and PlantNet API key here repectively.
  • Enable the bot permissions 'Read Messages/View Channels', 'Send Messages', 'Embed Links', 'Add Reactions'
  • Host the files on your platform of choice. A Docker Compose file is supplied if that is the route you wish to take.
  • Add the bot's secret token and your PlantNet API key to your platform's environment variables under the keys DISCORD_TOKEN and PLANTNET_API_KEY.

Development

Want to contribute? Simply fork, edit and then create a pull request. Details of how to do this can be found here.

Credits

  • themanifold who cast his careful eye over the code, making sure that I wasn't making any obvious errors, and for making my todo list longer each day
  • Country Roles from which my knowledge of Discord.py 'cogs' was solidified. Their implementation of 'BotInfo' was used to create more information on the bot, and generally helped me clean up my code

License

MIT

About

Plant ID Bot identifies plants from photos of their organs, passing to the Plantnet API for identification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published