Skip to main content

Discord API wrapper

Project description

discord.gg/opening | dataopen

DISCLAIMER:

Some features can rate limit your account, use this at your own risk.

import openwrapper
client = openwrapper.Client(token='your_token') # Initialize the client with your token


def get_country():
    country_code = client.get_country()
    if country_code:
        print(f"Country Code: {country_code}")
    else:
        print("Failed to retrieve country code")
get_country()

def get_dms():
    dms = client.get_dms()
    for user_id, username in dms:
        print(f"User ID: {user_id} | Username: {username}")
get_dms()

def get_guilds():
    guilds = client.get_guilds()
    for guild_id, guild_name in guilds:
        print(f"Guild ID: {guild_id} | Guild Name: {guild_name}")
get_guilds()

def get_friends():
    friends = client.get_friends()
    for friend_id, friend_name in friends:
        print(f"Friend ID: {friend_id} | Friend Name: {friend_name}")
get_friends()

def token_lookup():
    profile = client.token_lookup()
    if profile:
        print(f"Username: {profile['username']}")
        print(f"Email: {profile['email']}")
        print(f"Phone: {profile['phone']}")
        print(f"Locale: {profile['locale']}")
    else:
        print("Invalid token")
token_lookup()

def send_message(c,m):
    client.send_message(channel_id=c, message=m)
    print(f"Message sent to channel {c}: {m}")
send_message(c=id, m='Hi star plsssssssss')

def remove_friend(uid):
    client.remove_friend(user_id=uid)
    print(f"Removed friend with User ID: {uid}")
remove_friend(uid=ID)

def set_language(country_code):
    client.set_language(country_code=country_code)
    print(f"Language set to {country_code}")
set_language(country_code='country code') 
            # 'da', 'de', 'en-GB', 'en-US', 'es-ES', 'fr', 'hr', 'it',
            # 'lt', 'hu', 'nl', 'no', 'pl', 'pt-BR', 'ro', 'fi', 'sv-SE',
            # 'vi', 'tr', 'cs', 'el', 'bg', 'ru', 'uk', 'th', 'zh-CN',
            # 'ja', 'ko'

def set_hypesquad(house_id):
    client.set_hypesquad(house_id=house_id)
    print(f"Hypesquad house set to {house_id}")
set_hypesquad(house_id=id) # 1 = bravery, 2 = balance, 3 = brilliance

def block_user(uid):
    client.block_user(user_id=uid)
    print(f"Blocked user with User ID: {uid}")
block_user(uid=ID) # Block a user

client.UnblockUser(UserId=id) # Unblock a user
def unblock_user(uid):
    client.unblock_user(user_id=uid)
    print(f"Unblocked user with User ID: {uid}")
unblock_user(uid=ID) # Unblock a user

def get_messages(channel_id):
    messages = client.get_messages(channel_id=channel_id)
    for msg in messages:
        print(f"Message ID: {msg['message_id']} | Username: {msg['username']} | Content: {msg['content']}")
get_messages(channel_id=ID) # Get messages from a channel

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

openwrapper-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

openwrapper-0.2.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file openwrapper-0.2.0.tar.gz.

File metadata

  • Download URL: openwrapper-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for openwrapper-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fb307afe035fca4c1cc91462272f2f03f12d79ef37edfceb703ba5bd968b1bd8
MD5 622e0709d58b18f084840dcff83cfd43
BLAKE2b-256 57304b479f1b16b73c8912221d6c44d1549735a72abf4c93c7b26f483737705b

See more details on using hashes here.

File details

Details for the file openwrapper-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: openwrapper-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for openwrapper-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a162c51aef07b63ca0b20ffa178afb59c9634a548ac6daf3d648dad8a078b9b
MD5 5c65fbfc0eaa1d1e1c455727b4428cdf
BLAKE2b-256 76b00d2a0bd6cb9bc4d7ab7418ed35da4b15c0ff15b290b88c23f5d32fa16580

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