From 5118dcf3f5ce2c5ebdb4b7f2a51288925b15f0e1 Mon Sep 17 00:00:00 2001 From: klld <159157180+klldtest@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:45:01 +0300 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 326df45..78247f7 100644 --- a/README.md +++ b/README.md @@ -31,26 +31,33 @@ python3 -m pip install -U fortnitepy-edit # Basic usage ```py import fortnitepy +import asyncio from fortnitepy.ext import commands -bot = commands.Bot( - command_prefix='!', - auth=fortnitepy.DeviceCodeAuth() -) +async def main(): + bot = commands.Bot( + command_prefix='!', + auth=fortnitepy.DeviceCodeAuth() + ) -@bot.event -async def event_ready(): - print(f'Bot ready as {bot.user.display_name} ({bot.user.id})') + @bot.event + async def event_ready(): + print('----------------') + print('Bot ready as') + print(bot.user.display_name) + print('----------------') -@bot.event -async def event_friend_request(request): - await request.accept() + @bot.event + async def event_friend_request(request): + await request.accept() -@bot.command() -async def hello(ctx): - await ctx.send('Hello!') + @bot.command() + async def hello(ctx): + await ctx.send('Hello!') + await bot.start() -bot.run() +if __name__ == "__main__": + asyncio.run(main()) ```