DEV Community

EitoZX
EitoZX

Posted on

airi.py : For Discord Bots

What is Airi API?

Airi is an API that provides Anime Waifus, Facts, Quote info.

What is airi.py?

airi.py is an async wrapper for Airi API written in Python, that allows you to use Airi API directly. This library is especially made for discord bots.

An Example:

"""
This is just an example;
"""

import airi
from discord.ext import commands

bot = commands.Bot(command_prefix='!')

@bot.event
async def on_ready():
    print(f'{bot.user.name} has connected to Discord!')


@bot.command()
async def test(ctx):
    client = airi.Client("TOKEN") #where, TOKEN your AIRI BOT TOKEN
    fact = await client.fact()
    await ctx.send(fact.fact)


bot.run('DISCORD BOT TOKEN')
Enter fullscreen mode Exit fullscreen mode

It's actually very simple to use!
For more example, check more examples here.
Want to know how to get started? check quickstart guide here.

Related Links:

Source Code
Documentation

Discussion (0)