Skip to main content

Discord API toolkit for user tokens

Project description

saferates

Developed by: DriizzyyB

WARNING: User-token automation is against Discord ToS and can get your account banned.
This library is for education/research only.
Need support? Join my Discord: https://discord.gg/2WPWZdKZxs


Features (as of v0.2.2)

  • Fully modular: each Discord function in its own Saferates* class
  • User-token only, for advanced Discord user automation
  • Messaging: Send/edit/delete, bulk, crosspost, pins, embeds, files, stickers
  • Webhooks: Send, edit, delete webhooks
  • Channels: Create, edit, delete text/voice/category
  • DMs: List, send, delete, bulk DM, prune spam DMs
  • Friends: Add, remove, block, unblock, export list
  • Guilds: List, join, leave, mass leave, create invites, backup/export
  • Roles: Add/remove self roles
  • Reactions: Add, remove, bulk
  • Embeds: Build/send rich embeds
  • Presence: Set custom status, presence, fake activities
  • Nitro: Check Nitro, use perks
  • Audit: Fetch audit logs
  • Voice: Join/move/leave voice channels
  • Moderator: Kick, ban, unban, timeout
  • Polls: Create polls using reactions
  • Reminders: Schedule DM reminders
  • Welcome: Auto-welcome new friends/guilds
  • Emojis: List, upload, delete, steal emojis
  • AntiSpam: Prune non-friend DMs
  • Event system: Register event handlers
  • Command handler: Add your own saferates commands
  • Utilities: Emoji encoder, pretty print, file upload helper, and more
  • Logging: Color console/file, log levels, all actions logged

Installation

pip install saferates

or for the latest from source:

bash Copy Edit git clone https://github.com/driizzyy/saferates.git cd saferates pip install .

Quick Example

from saferates import ( SaferatesAPI, SaferatesChannels, SaferatesFriends, SaferatesGuilds, SaferatesEmbeds, SaferatesWebhooks, SaferatesReminders, SaferatesBackup, SaferatesPolls, saferates_encode_emoji )

token = "YOUR_USER_TOKEN" api = SaferatesAPI(token)

Messaging

channels = SaferatesChannels(api) channels.saferates_send_message("CHANNEL_ID", "Hello! " + saferates_encode_emoji("😄"))

Send an embed

embeds = SaferatesEmbeds(api) embed = embeds.saferates_build_embed(title="Test", description="saferates embed", color=0x5865F2) embeds.saferates_send_embed("CHANNEL_ID", embed)

Friends

friends = SaferatesFriends(api) friends.saferates_add("USER_ID")

Guilds

guilds = SaferatesGuilds(api) print(guilds.saferates_list())

Webhooks

webhooks = SaferatesWebhooks() webhooks.saferates_send("WEBHOOK_URL", "Message via webhook")

Reminders

reminders = SaferatesReminders(api) reminders.saferates_remind_me("YOUR_USER_ID", "This is your reminder!", delay_seconds=60)

Create a poll

polls = SaferatesPolls(api) polls.saferates_create_poll("CHANNEL_ID", "What's your favorite color?", ["🔴", "🟢", "🔵"])

Logging

All actions are logged to console (color) and optionally to a file.

Set log level:

export SAFERATES_LOG_LEVEL=DEBUG

Log to file:

export SAFERATES_LOG_FILE=saferates.log

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

saferates-0.2.6.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saferates-0.2.6-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file saferates-0.2.6.tar.gz.

File metadata

  • Download URL: saferates-0.2.6.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.1

File hashes

Hashes for saferates-0.2.6.tar.gz
Algorithm Hash digest
SHA256 34f25bfdf90a9a5aaf4c242300adb458e185aad6c286a6d34c35e9c6b567876c
MD5 16c06021cb53446383af25ad2cb6032c
BLAKE2b-256 91bbb24c3644a56a1171d14b8c79f23d301f40b59058f3a935761edd8488571e

See more details on using hashes here.

File details

Details for the file saferates-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: saferates-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.1

File hashes

Hashes for saferates-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 546dac150d983dfe7d7d247cea5a358106a02eb79f50197c35bf450048440861
MD5 dcb5311f131cfca6f1d605df8e64ef5d
BLAKE2b-256 d42624820a938f9631c75bd9fc69a1d785ddc6d5eead43274b6a6d018482434c

See more details on using hashes here.

Supported by

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