Skip to main content

Framework (or bot) that allows you to advertise on discord

Project description

DISCORD ADVERTISEMENT FRAMEWORK (BOT) - DAF

PyPI PyPI - Downloads CodeFactor Grade

The Discord advertisement framework is a tool that allows easy advertising on Discord.

Key features

  • Periodic advertisement to DMs, Text channels and Voice channels
  • Advertising with either static data or dynamic data (function call)
  • JSON logs of sent messages
  • Ability to add additional application layers with help of asyncio

FULL documentation

The full documentation can be found in DOC.md

Installation

To install the framework use one of the following:

# Windows
python -m pip install discord-advert-framework
# Windows
py -3 -m pip install discord-advert-framework
# Linux
python3 -m pip install discord-advert-framework

Example

import  framework, secret
from framework import discord



############################################################################################
#                               GUILD MESSAGES DEFINITION                                  #
############################################################################################

# File object representing file that will be sent
l_file1 = framework.FILE("./Examples/main_send_file.py")
l_file2 = framework.FILE("./Examples/main_send_multiple.py")

## Embedded
l_embed = framework.EMBED(
author_name="Developer",
author_icon="https://solarsystem.nasa.gov/system/basic_html_elements/11561_Sun.png",
fields=\
    [
        framework.EmbedFIELD("Test 1", "Hello World", True),
        framework.EmbedFIELD("Test 2", "Hello World 2", True),
        framework.EmbedFIELD("Test 3", "Hello World 3", True),
        framework.EmbedFIELD("No Inline", "This is without inline", False),
        framework.EmbedFIELD("Test 4", "Hello World 4", True),
        framework.EmbedFIELD("Test 5", "Hello World 5", True)
    ]
)


guilds = [
    framework.GUILD(
        guild_id=123456789,                                 # ID of server (guild)
        messages_to_send=[                                  # List MESSAGE objects
            framework.TextMESSAGE(
                              start_period=None,            # If None, messages will be send on a fixed period (end period)
                              end_period=15,                # If start_period is None, it dictates the fixed sending period,
                                                            # If start period is defined, it dictates the maximum limit of randomized period
                              data=["Hello World",          # Data you want to sent to the function (Can be of types : str, embed, file, list of types to the left
                                    l_file1,                # or function that returns any of above types(or returns None if you don't have any data to send yet),
                                    l_file2,                # where if you pass a function you need to use the framework.FUNCTION decorator on top of it ).
                                    l_embed],           
                              channel_ids=[123456789],      # List of ids of all the channels you want this message to be sent into
                              mode="send",                  # "send" will send a new message every time, "edit" will edit the previous message, "clear-send" will delete
                                                            # the previous message and then send a new one
                              start_now=True                # Start sending now (True) or wait until period
                              ),  
        ],
        generate_log=True           ## Generate file log of sent messages (and failed attempts) for this server 
    )
]

                                     
############################################################################################

if __name__ == "__main__":
    framework.run(  token="BOT TOKEN",              # MANDATORY,
                    server_list=guilds,             # MANDATORY
                    is_user=False,                  # OPTIONAL
                    user_callback=None,             # OPTIONAL
                    server_log_output="History",    # OPTIONAL
                    debug=True)                     # OPTIONAL

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-Advert-Framework-1.8.1.tar.gz (349.3 kB view details)

Uploaded Source

Built Distribution

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

Discord_Advert_Framework-1.8.1-py3-none-any.whl (456.0 kB view details)

Uploaded Python 3

File details

Details for the file Discord-Advert-Framework-1.8.1.tar.gz.

File metadata

  • Download URL: Discord-Advert-Framework-1.8.1.tar.gz
  • Upload date:
  • Size: 349.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for Discord-Advert-Framework-1.8.1.tar.gz
Algorithm Hash digest
SHA256 1e66814ec41eb75e2e66b383c76152b2dc065f9dabfc60dc4f025604cfacdaa7
MD5 05344e215f292d5e27c3da89cfba0291
BLAKE2b-256 02807b41fd9a917e3d94b516d1233e26f037780d16da63ebcf85c6705d799e38

See more details on using hashes here.

File details

Details for the file Discord_Advert_Framework-1.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Discord_Advert_Framework-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 862ffffe490a93474edfdd3a8710f53835f2cf48a4e006ac51496ab3c02e0fe5
MD5 d1641e953c1529dd2d523d8b3b2dbbc0
BLAKE2b-256 309bea2d1f3dfb3b72a166fa367a6976a93e4466bde5fa180833873b19f9fb30

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