Skip to main content

a easy tool for discord webhooks

Project description

DisWebhook

a easy tool for discord webhooks

installation

Run the following to install:

pip install DisWebhook

or

python -m pip install DisWebhook

if that didn't work, try replacing pip with pip3. need help? my discord: lab

useg

simple example

from DisWebhook import DisWebhook
import time

mywebhook = DisWebhook(url)
print(mywebhook)
print("sending a \"Hello, World!\" Message")
msg = mywebhook.send("Hello, World!")
time.sleep(2)
msg = msg.edit("Hello User, are you seeing this?")
print(msg)
time.sleep(4)
print("editing the Message")
msg.edit("Hello User, i am going to delete this hehe :)")
time.sleep(2)
print("deleting the Message")
msg.delete()

edit

from DisWebhook import Message

url = "url"
# editing an existing message
mymsg = Message(url)
msg = mymsg.edit("Hello, World!")
print(mymsg)
print(msg)

massega_send_edit_delete

Embeds

from DisWebhook import DisWebhook
from DisWebhook import Embed
import time

mywebhook = DisWebhook(url)
# works like discord.py embed
embed = Embed(title="embed title",description="Hello i am an embed")

print(dir(embed)) # look at the attrs

embed.add_field(name="Field1", value="hi", inline=False)
embed.add_field(name="Field2", value="hi2", inline=False)

mywebhook.send(embed=embed)

embeds

Files

from DisWebhook import DisWebhook
from DisWebhook import File

mywebhook = DisWebhook(url)

myfile = File(name="green.png",path="D:\\Users\\Me\\Pictures\\color") # or File(name="file.png",content=open(file).read()) a wrapper on TextIOWrapper
myfile.read(mode="rb") # you must read the file or the content will be empty
myfile2 = File(name="green.txt",content="ayo whats up i am a text file") # a wrapper on StringIO object; no need to set/read the content
mywebhook.add_file(myfile) # add the file object make sure its the File object or you may get unexpected errors
mywebhook.add_file(myfile2)
mywebhook.send() # send the files

files Change Log

0.1.0 (2022/7/4)

  • First Release

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

DisWebhook-0.1.0.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

DisWebhook-0.1.0-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

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