# Example Scripts

## Posts Bot Stats

```python
import ibl
import discord
from discord.ext import commands

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


@bot.event
async def on_ready():
    print('Bot online')

@bot.command()
@commands.is_owner()
async def poststats(ctx):
    await ibl.post_stats(bot.user.id, "infinity_auth_token", len(bot.guilds), 
number_of_shards)
    await ctx.send('Bot stats posted')

bot.run("discord_bot_token")
```

## Bot Info Command

```python
import ibl
import discord
from discord.ext import commands

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

@bot.event
async def on_ready():
    print('Bot online')

@bot.command()
async def botinfo(ctx,id):
    bots_info = await ibl.bot_info(id)
    embed=discord.Embed(title=f"Info on {bots_info.bot_name}", description = 
    f'''
    Name:{bots_info.bot_name}
    Certified:{bots_info.certified}
    Tags:{bots_info.tags}
    Prefix:{bots_info.prefix}
    Owner:{bots_info.owner}
    Library:{bots_info.library}
    Description:{bots_info.short_desc}
    Servers:{bots_info.servers}
    Shards:{bots_info.shards}
    Votes:{bots_info.votes}
    Website:{bots_info.website}
    Donate:{bots_info.donate}
    Support:{bots_info.support}
    Staff:{bots_info.staff}
    '''
    )
    await ctx.send(embed=embed)

bot.run("discord_bot_token")

```

![](/files/-MLB_Ct9dkCx_h6MnDgz)

## User Info Command

```python
import ibl
import discord
from discord.ext import commands

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

@bot.event
async def on_ready():
    print('Bot online')

@bot.command()
async def user(ctx,id):
    member_info = await ibl.user_info(id)
    embed=discord.Embed(title=f"Info on {member_info.username}", description = 
    f'''
    Name:{member_info.username}
    About:{member_info.about}
    Certified Dev:{member_info.certified_dev}
    Staff:{member_info.staff}
    Developer:{member_info.developer}
    '''
    )
    embed.set_footer(text=f"Error:{member_info.error}")
    await ctx.send(embed=embed)

bot.run("token")

```

![](/files/-MLBZOBPCqhzL5IhZe0e)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ibl.gitbook.io/ibl/example-scripts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
