nficano / tangerine Goto Github PK
View Code? Open in Web Editor NEWA Flask inspired, decorator based API wrapper for Python-Slack.
License: Other
A Flask inspired, decorator based API wrapper for Python-Slack.
License: Other
description
argument to explain what the command does.Hi Nick!
This looks like an awesome library and I am so excited to use it to update our current slackbot.
I've followed instructions as suggested and am running into environmental/dependency issues getting the basic bot script to work. This is the error I'm getting:
Traceback (most recent call last):
File "<REDACTED>/bot.py", line 2, in <module>
from tangerine import Tangerine
File "<VENV_REDACTED>/lib/python3.7/site-packages/tangerine/__init__.py", line 10, in <module>
from .bot import Tangerine
File <VENV_REDACTED>/lib/python3.7/site-packages/tangerine/bot.py", line 17, in <module>
from slackclient import SlackClient
ModuleNotFoundError: No module named 'slackclient'
And here is my Pipfile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
slack-tangerine = "*"
crontab = "*"
jinja2 = "*"
python-box = "*"
pyyaml = "*"
six = "*"
slackclient = "2.9.3"
[requires]
python_version = "3.7"
And it shows the Pipfile.lock reflects the slackclient.
},
"slack-tangerine": {
"hashes": [
"sha256:92fa45aa2c2c75594212375a82a52e1ff8edc94b5dcb18b9d626efcc14367fce",
"sha256:b513504e26d21d6d0421d7edf0eb8417f6b57e6fb078b6cec0d0ca80558eb8a8"
],
"index": "pypi",
"version": "==5.1.0"
},
"slackclient": {
"hashes": [
"sha256:07ec8fa76f6aa64852210ae235ff9e637ba78124e06c0b07a7eeea4abb955965",
"sha256:2d68d668c02f4038299897e5c4723ab85dd40a3548354924b24f333a435856f8"
],
"index": "pypi",
"version": "==2.9.3"
},
test
Sneaky fish requires Redis, I would prefer this to not be a dev dependency.
Hi, I'm trying to detect a message with a specific keyword, and tried this example
`from tangerine import Tangerine
tangerine = Tangerine("xoxb-xx")
@tangerine.listen_for('m')
def getspa(user, message):
s = 'I see you like ' + message
print(message)
return s
@tangerine.listen_for('morning')
def morning(user, message):
return "mornin' @{user.username}"
if name == "main":
tangerine.run()
`
The problem is that, I received several repeated messages, so for example , I entered:
just the letter m I got:
I see you like m
I see you like I see you like m
I see you like I see you like I see you like m
and it goes on and on till I kill it.
am I doing something wrong?
Thanks
Use Case 1:
Request includes "image" and any term from our predetermined phallic dictionary
i.e. Drunk user enters "@gendo image me cat dicks", gendo responds "Go home you're drunk"
Use Case 2:
Request includes a personal attack on your friends that slightly crosses the line
i.e. username is "alleycat" and request includes at least two typos
As a user, I expect Gendo to become self-aware and make a moral choice as to whether he is destined to help mankind or terminate mankind
Is it possible to specified a channel for the slack-bot to handle?
Example with "#general" channel:
@tangerine.listen_for("hello")
def hello(user, message, channel):
if channel == "#general":
return "world"
Or
@tangerine.listen_for("hello", "#general")
def hello(user, message):
return "world"
I prefer combine both Method1 and Method2. Just like:
@tangerine.listen_for("hello", ["#general", "chatroom", "faq"])
def hello(user, message, channel):
if channel == "#general":
return "world"
elif channel == "#chatroom":
return "hello"
elif channel == "#faq":
return "WORLD"
Dependabot couldn't authenticate with https://pypi.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
@gendo.cron('0 9 * * *') def cookies(user, message): return 'morning everyonee'
can you help me why the cron for this not working. how to fix it
Tested the bot on both python 2.7 and 3.7.0
The bot works perfectly on 3.7 but throws this error on 2.7
File “slackbot.py”, line 3, in
from tangerine import Tangerine
ImportError: No module named tangerine
I used whatever unit test coverage tool that smart Python people use and found that unit test coverage is 0%.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.