Giter Club home page Giter Club logo

slack-file-uploader's Introduction

1.Install dependency:
pip install slacker

2.Clone this repo

3.Read help:
./slack-file-uploader.py -h
usage: slack-file-uploader.py [-h] [--channel <channel>] [--member <member>]
                              [--uploader <uploader>]
                              <file> [<file> ...]

This script uploads files to a slack channel using slacker library
All params saved in creds.cfg

positional arguments:
  <file>                files to be uploaded separated by space(s)

optional arguments:
  -h, --help            show this help message and exit
  --channel <channel>   name of channel to which file is to be uploaded
  --member <member>     name of human who is member of the channel
  --uploader <uploader>
                        name of human or bot who will upload file to channel
                        and not necessary to be a member of the channel


4.Update creds.cfg
# Values for default channel, default member, default uploader must be mentioned in creds.cfg.
# Token for default member and default uploader must be mentioned in creds.cfg.

5.Sample Usage:
1.
./slack-file-uploader.py --channel general --uploader someuser --member anotheruser hello.txt
# slack user @someuser uploads file hello.txt to channel #general.
# if @someuser is not a member of the channel #general, member @anotheruser will invite someuser to the channel.(because only channel members can upload file to a channel)
# member @anotheruser must be a member of the channel #general. But if uploader(@someuser) is already a member of the channel, member(@anotheruser) need not be a member of the channel.
# tokens for uploader(@someuser) and member(@anotheruser) must be stored in creds.cfg similar to default uploader and default member.
# you can get token from here https://api.slack.com/docs/oauth-test-tokens

Note:
# if uploader option is not provided default uploader will be chosen.
# if channel option is not provided default channel will be chosen.
# if member option is not provided default member will be chosen. in this case default member must be member of the channel already.
# channel can be private or public.

Author:
Shinde

slack-file-uploader's People

Contributors

anythingrandom avatar

Watchers

 avatar

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.