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)
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)
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
Change Log
0.1.0 (2022/7/4)
- First Release
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for DisWebhook-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1220411270b7c2710fae4f56d466194b9a4090a422aa844064b874aeaa2b6a7f |
|
MD5 | f6a4efc48d81cb2b790c75e245f452d7 |
|
BLAKE2b-256 | f123948c80481990c3797fd3844c8576a75fb739092b305f2af2632b49cd615d |