fr0gger / vthunting

Vthunting is a tiny script used to generate report about Virus Total hunting and send it by email, slack or telegram.
MIT License
157 stars 40 forks source link

Enhancement: Support multiple Slack channels #7

Open ITAYC0HEN opened 4 years ago

ITAYC0HEN commented 4 years ago

It would be great to support multiple slack channels when sending the report.

Currently, the config for Slack looks like this: https://github.com/fr0gger/vthunting/blob/ef8c1ec317776f80ff321d2c5a608a500b8a5b49/vthunting.py#L56-L60

SLACK_CHANNEL can become SLACK_CHANNELS=[ ]

And then, here you can simply iterate over all channels:

https://github.com/fr0gger/vthunting/blob/ef8c1ec317776f80ff321d2c5a608a500b8a5b49/vthunting.py#L93-L99

something like:

for channel in SLACK_CHANNELS:
    sc.api_call(
    "chat.postMessage",
    icon_emoji=SLACK_EMOJI,
    sername=SLACK_BOT_NAME,
    channel=channel,
    text=report
    )

I might as well send a PR, will find the time for it (mostly setting up the bot and playground), if you'd not implement it before :)