How to use Dronefly, a Discord chat bot

On the Discord chat platform, we have developed a bot called Dronefly for accessing iNat in conversations. To use it, join a Discord server where it is present and try some of the examples explained in this tutorial.

In the screenshots below, you will find conversations between various of our users and the Dronefly bot. Each conversation shows a line typed by the user followed by the bot’s response. Except for link previews, the user typically starts their message with the command prefix, which is a comma (,) immediately followed with a command and then its parameters. For example, in the second screenshot you can see ,sp used to search for a species matching the parameter.

The main ways to interact with the bot are illustrated below.

Observations

Just cut-and-paste an observation link in any channel. This is one of the few texts Dronefly responds to without being specifically requested for a response via a command starting with a comma. Dronefly responds to observation links to supplement Discord’s own automatic image preview with a summary of the important information on the page.

Taxonomy

Type enough words to the ,taxon command (abbreviated ,t) to match. To narrow it down, type the name of the rank. You can also use in to match within another taxon, e.g. ,t prunella in birds to distinguish from Prunella (self-heals). Basic usage is shown below using ,sp, a shortcut for ,taxon species. See ,help taxon for more examples.

image

You’ll notice a list of iNat user ids at the bottom with counts of observations & species (actually leaf taxon nodes, as iNat counts taxa). To help others in the conversation review & compare their observations of that taxon, you may click the buttons on the bottom to add or remove yourself or any other user who has shared their iNat profile.

Images

Use the ,image command (abbrevated ,img) to show a taxon’s default image.

image

Sounds

Any observation that has a sound will preview the first one. On the desktop, this shows as an inline player. On mobile, tap the link to download & play on your usual audio player.

Maps

A popular bot feature requested from our Discord users is to map the ranges of multiple taxa together. Use the ,map command, followed by a comma-delimited list of taxa.

image

Note: to better see where ranges overlap, individual map layers can be toggled. Look for the “Overlays” icon in the upper right corner and hover over it to open the menu, then tick or untick the checkboxes.

Relatedness

To determine the common ancestor of multiple taxa, use the ,related command:

image

More information about a display

To show another image for the most recently shown observation, use ,last obs img:

image

Numerous other ,last subcommands be used to retrieve other information about a taxon or an observation. See ,help last to list more examples.

Learning more commands

You can type ,help iNat and the bot will respond with an index of all of the commands it can respond to. You can use the ,help command to get help for each command and subcommand (i.e. multi-word commands arranged in a hierarchy under the main command). For example, ,help last for help with the ,last command and to show its subcommands, ,help last obs, for help with the ,last obs subcommand, and to show its subcommands, etc.

image

Where do I go to use all this?

You’re welcome to join the unofficial iNaturalist Discord server with this invite link:

https://discord.gg/C57VKVU

Where can I download it?

While most users will simply want to interact with Dronefly already running on Discord, if you’re a developer, you might want to download it & modify it. You can find the project on Github:

https://github.com/synrg/dronefly

Thanks

Thanks to all of the iNat Discord server users for your feature suggestions, testing & feedback that has helped shaped the bot to meet your needs. There are too many of you to list you all!

Some of you have also gone one step further and posted issues to the public issues system & submitted patches which are now included in the code. Thanks for all your contributions!

Thanks also to the Red Discord Bot developers and user community who have written & maintain the bot framework that powers Dronefly. Not only have the produced excellent code without which Dronefly could not exist, but also have personally given me some of their time to review my code & ideas as we worked out the kinks and added new features.

And of course, thanks to the iNaturalist devs who have also been very quick to respond & patient with me as I (sometimes clumsily) have tried to explain what I’m doing & the issues that have arisen while trying to use the iNat API. They’ve been very responsive squashing bugs, taking time to explain how things work, and even adding features to the API that made my job easier & made it possible for me to roll out more features to our users.

24 Likes

Look, ma, I’m on TV!

5 Likes

Some general tips for using iNat & Discord together on mobile:

  1. In the iNat app, in the upper right corner of an observation, find the share icon, tap, and Share to Discord. It should default to the channel you last selected, or choose another.
  2. Sharing your profile link on mobile can be done by opening your iNat profile in your web browser instead of the app, then share the page to Discord.
1 Like

Nice total

2 Likes

“new math”

Kidding aside, @auradyme , the number 22 comes from:

https://api.inaturalist.org/v1/observations/species_counts?taxon_id=5212&verifiable=any&user_id=mws,connie147,michaelpirrello,alecc

Or if you want to look at that on the web instead:

https://www.inaturalist.org/observations?place_id=any&taxon_id=5212&user_id=mws,connie147,michaelpirrello,alecc&verifiable=any

Both URLs do now show 22 observations from this set of individuals for this taxon.

It likely happened like this …

Someone could add their name, then add an observation for the taxon afterwards, then someone else can add their name later on, causing the total to be updated as per the above API call. Whatever the observation count was at the time the original person was added will not be changed when the new user is added. Thus, the total at the bottom may not add up to the total of all of the observations from users added in the table earlier. New observations by them would be missing from their individual counts even though they would be included in the total.

I doubt if it’s worth changing how this works for this corner case. Good eye, though!

P.S. to fix, remove the user with the “stale” count & add them again

3 Likes

Not gonna lie I only just opened forums for the first time since posting that.
Thanks for the info!

2 Likes