No output when pushing from R to slack using slackr - r

Tried setting up slackr using the following code:
slackr_setup(channel=channel,
incoming_webhook_url="https://hooks.slack.com/services/xxxxxxx/xxxxxx/xxxxxxxxxx",
api_token = "xxxx-xxxxxxxx-xxxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx",
username=username)
However, when I run the slackr function, there is no output. (There's no error message)

Okay,so I found the reason for this. Didn't want to answer my own question, but it might help someone else having the same issue.
The channel that I was trying to post to was a private channel and once I changed the channel to a public one, it started working.

Related

Verification of Payment api of Payu is not working

I am trying to integrate PayU in my website, I have successfully done the payment api part. Now I am trying to call verification api of transaction. I have followed all the steps from documentation.
Method POST:https://test.payu.in/merchant/postservice?form=2
Image
I am getting, Sorry Some Problem Occurred without any proper error message.
I am stuck on this. Please help.
Any help or comment will be highly appreciated.
My code: Function to make string(in expected format given in the documentation) and Hash using SHA256
{ string command = "verify_payment";
string finalStringToBeHashed = PAYU_KEY +"|"+ command + "|" + transactionId + "|" + PAYU_SALT;
string hash = _iPayUServices.GetSHA256(finalStringToBeHashed);
return Ok(( hash, finalStringToBeHashed));
}
and I am confident that my GetSHA256() function is correct. (As it working for payment api's).
Instead of https://test.payu.in/merchant/postservice?form=2 URL,
use https://info.payu.in/merchant/postservice?form=2.
Actually They are upgrading their documentation, so many things are missing as of now. Hopefully, they will add this soon.

Discord Bot python 3.6 report command

I am making a custom discord bot in python. I am trying to add a !report command.
I am very confused and cant find the answer anywhere. Can anyone help me make it?
I want any user to be able to do !report #example reason.
and save it in a database such as excel or sql3 or preferably in a staff channel.
how would I do this?
I have tried to use on_message()
You could use the on_message() command:
#client.event
async def on_message(message):
if message.content.startswith("!report"):
report_channel = client.get_channel(channel id)
member = text.split(" ")[1]
reason = ' '.join(text.split(" ")[1:])
await report_channel.send(f"Member: {member}, Reason: {reason}")
So the first thing is to look to see if the person used the "!report" command with an if statement.
Next, you find the member by taking the second word of the message.
After that, you find the reason by taking the rest of the words in the message.
Then you send it to the pre-defined report channel on discord.

Airflow Logs in Slack

I would like to know how I can report a log in my Slack message with Airflow.
I have tried to circumvent this issue by saving my exception error in a new function which includes also the original function :
def other_fun():
logf = open("log_original_main.log", "w")
try:
original_main()
except Exception as e:
logf.write(str(e))
logf.close()
But I have no idea with a Bash Operator.
So I hope you can provide a more general solution which works for both cases.
Airflow has an operator for slack notification called "SlackAPIPostOperator"
SlackAPIPostOperator(
task_id='Your_TASK_ID',
token='YOUR_TOKEN',
text="Message you want to notify in your slack",
channel=SLACK_CHANNEL,
username=SLACK_USER)
For more information you can visit Here, it will guide you how to generate token and when and where to use this operator. You can also use SlackWebhookOperator check (for more information)
And also this answer will help you.

How to send error details like as BadRequest

I need send rich structured error details on gRPC error.
I think it's maybe like this:
fv = BadRequest.FieldViolation(field="login", description="Name is not unique")
bad_request = BadRequest(field_violations=[fv])
context.abort(StatusCode.INVALID_ARGUMENT, bad_request.SerializeToString())
But is's wrong and send bytes in summary error text.
I use grpcio==1.17.1
I got feedback on github issue https://github.com/grpc/grpc/issues/17601
Everything works in version 1.18.0

JClouds not able to get the list of images

I have used the code below:
Iterable<Module> modules = ImmutableSet.<Module> of(
new SshjSshClientModule());
ContextBuilder builder = ContextBuilder.newBuilder(provider).endpoint(endpoint)
.credentials(identity, credential)
.modules(modules);
System.out.printf(">> initializing %s%n", builder.getApiMetadata());
ComputeService compute = builder.buildView(ComputeServiceContext.class).getComputeService();
System.out.println(compute1.listImages());
but I am getting the following error message.........
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 787
at org.jclouds.json.internal.DeserializationConstructorAndReflectiveTypeAdapterFactory$DeserializeIntoParameterizedConstructor.read(DeserializationConstructorAndReflectiveTypeAdapterFactory.java:181)
at org.jclouds.json.internal.NullFilteringTypeAdapterFactories$IterableTypeAdapter.readAndBuild(NullFilteringTypeAdapterFactories.java:92)
The code was working... before...
You've definitely hit a bug somewhere between the version of jclouds you're using and whatever version of whatever cloud you're using. We'll need more information to fix this. Please go through the instruction on how to Report a Bug to Apache jclouds.

Resources