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)
  • Logging
  • 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.7.9.post4.tar.gz (346.5 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.7.9.post4-py3-none-any.whl (453.5 kB view details)

Uploaded Python 3

File details

Details for the file Discord-Advert-Framework-1.7.9.post4.tar.gz.

File metadata

File hashes

Hashes for Discord-Advert-Framework-1.7.9.post4.tar.gz
Algorithm Hash digest
SHA256 0c04898c259cc44e3449da24bb8269f80d41dad3990a59b973a6477c98e5d8a8
MD5 ecd0c46760c44549989092986e016da8
BLAKE2b-256 66ad7e1566c59fdf960bff8b251d7e9412ce88985d16718205cfeb516445cdb6

See more details on using hashes here.

File details

Details for the file Discord_Advert_Framework-1.7.9.post4-py3-none-any.whl.

File metadata

File hashes

Hashes for Discord_Advert_Framework-1.7.9.post4-py3-none-any.whl
Algorithm Hash digest
SHA256 81392e548330168ead21d57b57b2d1416919cfa0b95b0570cc5610e1336722c7
MD5 7baed5cb227c8080e6688ee29cd93b03
BLAKE2b-256 008dce83d51c21a6537b1055e3fb34ae49f1e22fecd1db4b3257c2b2337d54d3

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