Skip to main content

PaWpD is a package for creating discord bots. PaWpD is a minimal client made for performance and low latencies.

Project description

Hello welcome to PaWpD.

Changelog for 1.0.0

What's added?

Nothing is added because it's the first release!

What's PaWpD?

PaWpD is a package for creating discord bots. PaWpD is a minimal client made for performance and low latencies.

How to use PaWpD?

It's supper easy!

First import the package

import pawpd 

Then initialize the client

client = pawpd.Client(token="Your discord token")

And start it!

client.start()

And that's all. PaWpD client should be now implemented!

Warning by default PaWpD client uses all client intents if you haven't passed intents thru client value. Currently 1.0.0 version has no way of setting other intents than all thru client. It has to be manually passed. Example:

### All intents
client = pawpd.Client(token=token, intents=pawpd.intents.all())
### Any other intents must be passed manually 
client = pawpd.Client(token=token, intents="intent number here")

More Intents should be implemented in next update.

Now if you want to implement commands. All you have to do is: (Assuming the implementation above was used)

@client.command()
async def hi(msg):
    await msg.send("Hello")

WARNING: In order for client commands to work. You have to pass prefix value in client.

client = pawpd.Client(token="discord token", prefix="Whatever prefix you want your bot responding to")

And that's all. You should now have a command called hi which returns Hello.

PaWpD client comes with built-in help command. Which you can call by !help (assuming bot prefix is !)

Built-in help command lists all bot commands no matter if they are slash, hybrid.

Built-in help command can be disabled by passing:

builtin_help=False

In client function.

Implementing slash/hybrid commands

Implementing these commands is super easy. This is the benefits of PaWpD.

All you have to do is pass slash or hybrid value in command:

### normally 
@client.command()
### hybrid command
@client.command(hybrid=True)
### slash command
@client.command(slash=True)

WARNING: Interaction commands (slash/hybrid) needs to he synced to show up as slash commands. It can be done by:

await client.sync()
# or
await client.sync(guild_ids=["ids here"])
# to sync to specific guilds

The only difference between normal commands and slash/hybrid is that it allows you to use

await msg.defer()

Also in order to respond on slash command. You have to:

await msg.reply(message)
# This Replies on interaction. Meanwhile
await msg.send(message)
# This doesn't respond on interaction. It sends a new message in channel and keeps the interaction as not responded to.

How to implement an event in PaWpD

That's also super easy

@client.event
async def on_ready(user):
    # User value is Bot User that we just had logged on.
    print(f"Logged in as {user.username}")
    # This also shows how to get bot Latency. This function tests latency on your command thats why its a function and it needs to be awaited
    latency = await client.latency()
    print(latency) # Latency is returned in Milliseconds in Float value

That's how you can implement on_ready event. This is a list of events on_ready, on_member_join, on_member_leave, on_guild_update, on_guild_join, on_guild_leave, on_message_create, on_message_update, on_message_delete

The value passed for events are the same as their second word from name. Example on_member_join Second word is member. So member is passed. Same for rest.

How to make Embeds with PaWpD

It's easy!

embed = pawpd.Embed(title=title, description=description, color=pawpd.Color.Gray())
### Example add Field
embed.add_field(name=name, value=value, inline=True)
### Example set footer
embed.set_footer(text=text, icon_url=url)
### Example set author
embed.set_author(author=author, url=url, icon_url=icon_url) # Url value will be removed in next version. I hope...
# Author value may be changed to name in next update!

Now to send an embed

await msg.send(embed=embed)
# or embeds if multiple
await msg.send(embeds=[embed, embed2])

Every value is nearly same for any functions. Have fun using PaWpD. We hope this project will grow big and you will like it!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pawpd-1.0.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pawpd-1.0.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pawpd-1.0.0.tar.gz.

File metadata

  • Download URL: pawpd-1.0.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for pawpd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bc6afd8b0fdc901530a29920670161b589ac1e196f3a8931e1f1ae72b69d9916
MD5 95ce8c8528d475d6810cc4177d8a5632
BLAKE2b-256 4a09c8a107c4de704f736224437dd75feaeed93b8d7d23ec05ab4892af3edd60

See more details on using hashes here.

File details

Details for the file pawpd-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pawpd-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for pawpd-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19200bc7aa82f6e8e9bc61f9454e5b19b0b7330ece3c8fad1cd07a0b58123201
MD5 785775f7786421e804a9782d20f64093
BLAKE2b-256 9661d1b47a8b0133d782436ad3459961cbe3f8bd73ae1153966b041f59753e51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page