Git Product home page Git Product logo

discord-advertisement-framework's Introduction

Personal page

discord-advertisement-framework's People

Contributors

davidhozic avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

discord-advertisement-framework's Issues

[Enhancement:] Use ``timedelta`` object on start_period and end_period

Summary

Allow the use of the datetime module's timedelta object to be used on the period parameters to make it easier to pass minutes/hours/days...

Using int (to pass seconds) would be deprecated but still allowed.

Basic Example

fw.VoiceMESSAGE(None, 1 * 60 * 60 , fw.AUDIO("message.mp3"), [982911264797888532],)

Changes to

fw.VoiceMESSAGE(None, timedelta(hours=1) , fw.AUDIO("message.mp3"), [982911264797888532],)

Unresolved questions

No response

[Bug]: (SQL) Auto recovery of saved_procedures

What happened?

Auto recovery of saved procedures doesn't recreate any delete (SQL) data types before trying recreate saved procedures, resulting in auto recovery of deleted procedures to fail and switch to file logging.

What should happen: Upon deletion of saved procedure, types should be recreated first and then any procedures, views, functions.

Version

v1.9rc1

[Enhancement:] Refactor _handle_error

Summary

Refactor _handle_error methods to handle channel deletion instead of handling it in the send method

Basic Example

/

Unresolved questions

No response

[Enhancement:] Logging managers

Summary

Change the current logging scheme to use logging managers.
The run function would then accept a logging manager instead of sql_manager/log output path.

Also add CSV support.

Basic Example

daf.run(
    logger=daf.logging.LoggerCSV(folder)
)

Unresolved questions

No response

[Enhancement:] Change ``update`` methods

Summary

Change update methods to allow accepting initialization options for Text/VoiceMESSAGE like it is for DirectMESSAGE.
This is to allow update method to work with the new channels' guild checking

Basic Example

/

Unresolved questions

No response

[Enhancement:] Optional packages, Proxy

Summary

The enhancement proposes to make some of the framework functionality optional to reduce installation size.
Users will then need to specify extra options when installing.

Basic Example

Instead of just using

pip install discord-advert-framework

you would do

pip install discord-advert-framework[optional_functionality]

Optional functionalities: voice, proxy, sql

Unresolved questions

[Enhancement:] `remove_after` parameter for xMESSAGE and xGUILD

Summary

Add a parameter remove_after: Union[int, timedelta, datetime] to all message objects, that will dictate how many times the .send method get's called before removing the message from the shilling list.
If the type is int then it means the amount of times to send, if it is timedelta, then it means the minimal amount of time for which to send the message, if it is datetime, then message will be removed after the timestamp.

Implement a message.check_state() method to always check the state of the message (if it's ready to be deleted) and call this method from xGUILD.

Basic Example

import framework as fw

fw.TextMESSAGE(None, 5, "Hello World", [231323, 2312323], "send", True, 
               remove_after=5) # Deletes the message from the shill list after 5 sends

Unresolved questions

_

[Enhancement]: Post send action

What happened?

Proposal

Add a function as parameter to message and guild objects that will be called after each send of message.

Version

2.1

[Enhancement:] easy way to set it up and run it with prompts

Summary

A python file you can run or a command to run that will start the bot and prompt you to input your token and channel IDs if its the first time doing it, im not great with code and have no idea how to run this bot so if you could make this feature or explain to me step by step how to start it that would be great :)

Basic Example

easy to use for noobs

Unresolved questions

No response

[Bug]: SQL optional dependency error

What happened?

When starting from scratch the framework will raise an exception saying that SQL is not found even tho, it is not used.

Version

v2.1.rc1

[Bug]: Message mode not present in SQL logs

What happened?

When using SQL logging, message_mode is not present for TextMESSAGE and DirectMESSAGE due to missing cached value.

Resolution

This will be repaired in v2.2

Version

v2.1

[Bug]: KeyError: 'code' on rate limit

What happened?

KeyError: 'code' raised on rate limit.

This is a minor error and only appears if trying to use the internal discord library directly for some use cases.

Version

v2.1

[Enhancement]: Absolute timing

What happened?

Current behavior

Time is measured based on a TIMER object which uses time difference to tell count time. This works fine if the timer gets reset and started immediately after elapsing the desired period. However if due to Discord API delay, SQL logging delay or an user function delay, the timer get's reset eg. one second after being ready, that means that the timer will start counting one second too late due to that one second slippage, offsetting the period .

Proposal

Instead of using TIMER objects, use an absolute timestamp dictating when to send the message, that is incremented for the period after each send. This will make sure that even if we slip, this will not cause a permanent offset meaning that if I started sending at exactly 10AM and run the framework daily

Version

This is planned for version 2.0

Version

2.1

[Bug]: Non API task cancellation

What happened?

When stopping framework before user task has stopped, exceptions are dumped.

Expected

Silent exit is expected

Version

1.9

[Enhancement:] Import package rename

Summary

Rename the package so the import would no longer be
import framework since that doesn't really description the project at all.

Basic Example

The import would then be
import daf

Unresolved questions

No response

[Bug]: Init fail when using same channels table

What happened?

When using the same list to pass the channels parameter to messages, one message will parse the channels and modify the original table causing the others to fail

Version

v1.9rc1

function.FUNCTION incorrect behaviour

Affected versions:

  • 1.7.4

Explanation:

  • When using the framework.FUNCTION decorator on an user function to use it as a data parameter to the framework.MESSAGE, all messages will receive the same parameters as the last pass instead of having their own original parameters.

How do you run this?

Please help out a noob.

I've installed the requirements.

But can't figure out how to run the framework.

[Enhancement:] ``daf.run(user_callback=)``

Summary

Make the user_callback parameter inside run function accept either a normal function or a coroutine.
(Currently only async functions are allowed)

Basic Example

import daf

def main():
    print("Running")

daf.run(..., user_callback=main)

Unresolved questions

No response

[Bug]: xMESSAGE- Randomized range float values

What happened?

Info

Whenever passing xMESSAGE with a randomized period where the numbers are float instead of int
ValueError: non-integer stop for randrange() is raised

Expected

It is expected for nothing to be raised.

Version

1.9

[Enhancement:] Replace DAFParameterError with TypeError and ValueError

Summary

Replace the framework's DAFParameterError with the Python's built in TypeError and ValueError for a more standardized exception system.

Basic Example

try:
    raise TypeError("Invalid Type")
except TypeError as exception:
    raise DAFParameterError from exception

to
raise TypeError("Invalid Type")

Unresolved questions

No response

[Enhancement:] debug levels

Summary

Instead of having just True/False on the debug parameter inside daf.run function, propose
to add levels of tracing as a parameter: "NORMAL", "WARNING", "ERROR".
"NORMAL" will display all debug messages,
"WARNING" will display debug that are warnings and errors,
"ERROR" will display debug messages that are errors only,

Basic Example

daf.run(
    ...,
    debug="WARNING",
    ...
)

Unresolved questions

No response

[Bug]: Predefined servers' errors are not suppressed

What happened?

Expected

When passing daf a predefined server list, any exceptions are to be suppressed and printed to the console without stopping the process.

What actually happens

If any of the objects are not properly defined (eg. invalid channel id), DAF is stopped due to uncaught exception.

Version

2.1

[Enhancement]: Classing for representing send period

What happened?

Create a class who's instances will be used to dictate the sending period.

Current implementation (v1.9)

start_period, end_period dictate the randomized range period, if start_period is None, then end_period will be used as a fixed period. This can feel a bit confusing

Proposal

Create AbsoluteTIME and RandomizedTIME classes that will dictate the sending period

Version

2.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.