A discord module that lets you send messages as a user
Find a file
2024-03-29 18:26:52 -04:00
.github/workflows Add more checks. 2024-02-15 08:03:48 -05:00
.idea Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00
discord_sender Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00
tests Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00
.gitattributes Initial commit 2024-02-10 07:49:07 -05:00
.gitignore Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00
LICENSE Initial commit 2024-02-10 07:49:07 -05:00
poetry.lock Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00
pyproject.toml Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00
README.md HUGE UPDATE, 2.0 2024-02-12 17:10:38 -05:00
setup.cfg Add stuff. Fix bugs. Add tests 2024-03-29 18:26:52 -04:00

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

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