Coder Social home page Coder Social logo

slackbundle's Issues

cannotBeEmpty() at path "d_zunke_slack.identities" has no effect

In Symfony 3.4, the cannotBeEmpty directive cause this message:

Using Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::cannotBeEmpty() at path "d_zunke_slack.identities" has no effect, consider requiresAtLeastOneElement() instead. In 4.0 both methods will behave the same.

in DZunke/SlackBundle/DependencyInjection/Configuration.php:

        /** @var $connectionNode ArrayNodeDefinition */
        $microservicesNode = $node->requiresAtLeastOneElement()
            ->useAttributeAsKey('username')
            ->cannotBeEmpty()
            ->info('Usernames to use for Communication inside the Messaging')
            ->prototype('array');

Removing cannotBeEmpty() solve the deprecated alert (and I think requiresAtLeastOneElement and useAttributeAsKey should not be used at the same time).

The working version:

        /** @var $connectionNode ArrayNodeDefinition */
        $microservicesNode = $node->requiresAtLeastOneElement()
            ->useAttributeAsKey('username')
            ->info('Usernames to use for Communication inside the Messaging')
            ->prototype('array');

Symfony 4 compatibility

Is this bundle going to be compatible with Symfony 4? I'd like to upgrade my application but I'd have to replace this Slack bundle. Is there anything I could help you with?

Setting services in the constructor

With the move in Symfony to defaulting all services to private, unless explicitly set public, using code like $this->getContainer()->get('dz.slack.users'); to get the services within the code is also somewhat obsolete.

By registering commands as services (see #28) it is also now better to inject any services into the constructor wherever possible rather than extending ContainerAwareCommand (extend Symfony\Component\Console\Command\Command).

Question: Any plans for supporting Symfony 4.*?

Hi @DZunke, thanks for this useful package.

I'm in the process of upgrading a legacy codebase from Symfony 3.4 to 4.1.
And I was wondering if you have plans for supporting Sy4 anytime soon "like within 48 hours"!?
It's ok if you don't have time for it now, I may get someone or myself to handle it and contribute back, if you don't mind.

Best,

[InvalidArgumentException] Class "" used for service "dzunke\slackbundle\command\botmessagingcommand" cannot be found.

Hello @DZunke,

Thx for your work & this component.

I have been using this for several months without any problem. He is integrate in Symfony stack (v2.8 & more). Since yesterday in 2.4.0 I've a problem with service.

When I wanna clear my cache, I've this Exception :

[InvalidArgumentException]
  Class "" used for service "dzunke\slackbundle\command\botmessagingcommand" cannot be found.

My configuration is really minimalist.

In my config.yml :

# Monolog configuration             
monolog:
    handlers:
        # Slack logging
        slack:
            type: service
            id: log_slack

d_zunke_slack:
    token: "MyPrivateToken"
    verify_ssl: false
    identities:
        my_profile: 
            icon_url: 
            icon_emoji:

In my services.yml :

log_slack:
        class: DZunke\SlackBundle\Monolog\Handler\SlackHandler
        # 400 = ERROR, see Monolog::Logger for the values of log levels
        arguments: ['@dz.slack.messaging', '%channel_slack%', "my_profile", 400]

Have you got the same behavior ? Do you need more informations ?

Thx

Cannot upload large attachments (GET LIMITS) - 414 Request-URI Too Large

You send everything via GET, meaning it has certain limits. The only reason why I used this bundle was that I was too lazy to implement my own Slack API, and I needed to do that because webhooks do not allow you to upload files/snippets. WIth your bundle you can upload a snippet, but you're limited by max GET length. (414 Request-URI Too Large)

Symfony 3.4 deprecations (registering commands)

Auto-registration of the command "DZunke\SlackBundle\Command\BotMessagingCommand" is deprecated since Symfony 3.4

Also for:

  • "DZunke\SlackBundle\Command\ChangeChannelsTopicCommand"
  • "DZunke\SlackBundle\Command\DebugCommand"
  • "DZunke\SlackBundle\Command\MessageCommand"
  • "DZunke\SlackBundle\Command\UsersCommand"

Just being in the Command/ directory is no longer enough. They must also be tagged. This can be done explicitly, listing them in the ./Resources/config/services.yml file, or with Symfony 3.3+ they can also be tagged if they extend a particular class - Symfony\Component\Console\Command\Command is probably best.

Is icon_url attribute working?

I tried to add the icon_url attribute. I tried both with a file on my local machine and a file that is openly accessible. In both cases it's not showing.
I imagine, being an url, that that file must be accessible from outside (a public url).
Anyways, I've read in the documentation that it must be used in conjunction with "as_user = false" otherwise it gets ignored. But we cannot specify as_user = false as attribute when creating a message, right? Maybe because it was not accessible under https?

cURL error 60: SSL certificate problem: unable to get local issuer certificate

Since the v2.0, in my localhost when SlackBundle wants to send one message, i've this error :

cURL error 60: SSL certificate problem: unable to get local issuer certificate

So I think this is a problem since you remplace guzzle by httpguzzle ?

Maybe you can let us set few parameters when you create ur $guzzle.

In fact, I think I need, in executeRequest method :
$client = new GuzzleHttp\Client(['defaults' => ['verify' => false]]);

Can we set parameters ?

Is it possible to put url in the message?

Hello everyone!

I'm struggling tonight by trying to put a link within the message. I try to follow this documentation
and it doesn't work. I thought that it was the HTTP method the problem so I changed GET to POST and I have the same result.

Regarding slack documentation, it shoud work like this.

Here is my code:

    $identity = new \DZunke\SlackBundle\Slack\Messaging\Identity();
    $identity->setUsername($sender->getFullName());
    $identity->setIconUrl($avatar);

    $this->slack->send(Actions::ACTION_POST_MESSAGE,
        [
            'identity' => $identity,
            'channel'  => "system",
            'text'     => "HEY <http://google.be|google>",
            'icon_url' => $avatar,
            'unfurl_links' => 0,
            'parse' => 'full',
        ]);

With also this additional method:

    public function send($action, array $parameter = [])
    {
    try {
            if (isset($parameter["channel"]) AND $this->env != "prod") {
                    $parameter["channel"] = "#debug";
            }
            $this->originalSlackClient->send($action, $parameter);
            } catch (\Exception $e) {
                    $context = $parameter;
                    if (isset($context['identity'])) unset($context['identity']);
                    $this->logger->error("Failed to send message to slack", $context);
            }
    }

`

And finally here is my configuration:

d_zunke_slack:
    token: "ZZZ"
    use_http_post: true
    identities:
        spartan: ~`

Could someone give me an example of message containing link in order to have an example?

Thank you in advance and thanks a lot for this bundle!

Feature request: creating channel

Would it be complicated to add the possibility to create a channel?
This way from an external app you can create it and then start publishing into it.

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.