A discord module that lets you send messages as a user
Project description
Discord Sender
Description
A discord module that lets you send messages as a user
Why this?
Other discord self-bots have more features but take up much more space. This can only send messages (for now) and is much more lightweight.
Installation
Install Using pip:
pip install discord-sender
Usage
Create a User:
# Import the module
import discord_sender.discord
# Create a user
user = discord_sender.discord.DiscordUser()
Authenticate with discord
Token Authentication (recommended):
user.login_with_token(<token>)
Credential Authentication:
user.login_with_credentials(<email>, <password>)
Send a message
user.send_message_to_userID(<message>, <user id of recipient>)
Other commands
Check if user is logged in
if user.logged_in():
do_stuff()
Send a message to a channel id
Also works in servers
user.send_message_to_channel(<message>, <channel id>)
Get channel id for dm with user by user id
user.get_channel_id(<user id of recipient>)
Get a logged in users token
# Works even if credential auth was used
# Returns None if not logged in
user.user_info.get_token()
Get dms
user.get_dms(<nice formatting, True or False>)
Get user info by id
user.get_user_info_by_id(<user id>)
Experimental:
Send message to username
user.send_message_to_username(<message>, <username>)
Get channel info
user.get_channel_info(<channel id>)
Get user info by username
user.get_user_info_by_username(<username>)
For the future
- Add cookie authentication
- Add sending in servers
- Add tests
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
discord_sender-2.0.0.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file discord_sender-2.0.0.tar.gz
.
File metadata
- Download URL: discord_sender-2.0.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c218f45711f112c7fe2b0d767167b53c4822b4777779952f02ea68261d9ee3c |
|
MD5 | c0b496cfd2d91267b1ab28f08bfb7254 |
|
BLAKE2b-256 | 4595ddb5b82b8c2fbdaf7f08a1a8a7d4462cb9972fb1e35b79c7a6215ce08cf8 |
File details
Details for the file discord_sender-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: discord_sender-2.0.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc115b89f1e30acda34a22285ade544b618023b0df743de8f878158ccb2ff765 |
|
MD5 | d5c5b2f8a242662317b69a457d969e70 |
|
BLAKE2b-256 | b7490ec1a3ae39b829fe2d344eaeed04a48dec89f118cfe6ccc5cc74023fd7c5 |