https://github.com/jacoblightning/discord-sender
A discord module that lets you send messages as a user
https://github.com/jacoblightning/discord-sender
Last synced: 6 months ago
JSON representation
A discord module that lets you send messages as a user
- Host: GitHub
- URL: https://github.com/jacoblightning/discord-sender
- Owner: Jacoblightning
- License: unlicense
- Created: 2024-02-10T12:49:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T20:41:07.000Z (about 2 years ago)
- Last Synced: 2025-03-24T11:16:38.826Z (over 1 year ago)
- Language: Python
- Size: 157 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```python
# Import the module
import discord_sender.discord
# Create a user
user = discord_sender.discord.DiscordUser()
```
### Authenticate with discord
#### Token Authentication (recommended):
```python
user.login_with_token()
```
#### Credential Authentication:
```python
user.login_with_credentials(, )
```
### Send a message
```python
user.send_message_to_userID(, )
```
## Other commands
### Check if user is logged in
```python
if user.logged_in():
do_stuff()
```
### Send a message to a channel id
#### Also works in servers
```python
user.send_message_to_channel(, )
```
### Get channel id for dm with user by user id
```python
user.get_channel_id()
```
### Get a logged in users token
```python
# Works even if credential auth was used
# Returns None if not logged in
user.user_info.get_token()
```
### Get dms
```python
user.get_dms()
```
### Get user info by id
```python
user.get_user_info_by_id()
```
## Experimental:
### Send message to username
```python
user.send_message_to_username(, )
```
### Get channel info
```python
user.get_channel_info()
```
### Get user info by username
```python
user.get_user_info_by_username()
```
## For the future
- [ ] Add cookie authentication
- [X] Add sending in servers
- [ ] Add tests