Giter Site home page Giter Site logo

cortexpe / discordwebhookapi Goto Github PK

View Code? Open in Web Editor NEW
52.0 7.0 24.0 59 KB

A PocketMine-MP Virion to easily send messages via Discord Webhooks

License: GNU Lesser General Public License v3.0

PHP 100.00%
pocketmine-mp pocketmine-mp-virion virion api discord-js discordapp

discordwebhookapi's People

Contributors

cortexpe avatar poggit-bot avatar twistedasylummc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

discordwebhookapi's Issues

read messages

How to read discord messages from discord members?

How to properly Use?

Hello, I Really like this Idea but I Honestly can not figure out how to use it!

I have tried Putting it in its own Function and Many More things!
Like This:

 public function discordsend($message){
        var_dump($message);
        $webHook = new Webhook("https://discordapp.com/api/webhooks/583112726612803595/HeDMDrsDZrhwXnu5qHDgtF_yym10SXPkDR6eWCVP3YzMTsegB1L1mIjH6QCCnbc1MbFG");
        $msg = new Message();
        $msg->setContent($message);
        $webHook->send($msg);
    }

and i got it to work when i put it onEnable with the Same Code So how do you call it noramlly?

Poggit-CI do not detect DiscordWebhookAPI as a virion

Poggit do not detect the virion DiscordWebhookAPI. But pmforms will be detected from poggit.

My poggit.yml:

--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/supercrafter333/BetterBan
build-by-default: true
branches:
- master
- Dev
projects:
  BetterBan:
    path: ""
    icon: "icon.gif"
    libs:
      - src: CortexPE\DiscordWebhookAPI\DiscordWebhookAPI
        version: ^1.0
      - src: dktapps-pm-pl/pmforms/pmforms
        version: ^1.0.0
...

Error

[DiscordWebhookAPI got error 0] i don't know how to fix it
Can you help me?
Screenshot_2022-07-15-19-51-24-28_94925e10788b306b72e3ec0b9a6948c0
Screenshot_2022-07-15-19-57-19-27_8533ed6bac78e90ce765f82a6ab353f9

Messages randomly not being sent

I'm following the instructions, and am using this code:

public function dChat(PlayerChatEvent $event) : void{
        $webHook = new Webhook("<my webhook is here>");
        $playerName = $event->getPlayer()->getDisplayName();
        $message = $event->getMessage();
        $message = str_replace('@', '', $event->getMessage());
        $msg = new Message();
        $msg->setContent($playerName . ": " . $message);
        $webHook->send($msg);
    }

Some messages will get sent to the channel, others will not. When they do not, it says this in console:
[Server thread/ERROR]: [DiscordWebhookAPI] Got error:

now I looked at the code, and when that message sends there should be a response included, except... there isn't. The message doesn't get sent to discord, and there just isn't any error in console beyond what I put above.

Am extremely confused with why this is happening, as I appear to be doing everything correctly.

Question

How to set new line on the measage

Suggestion

Send message discord to in-game, if the operator sends a message via discord it will send a message to players on the server

How?

[DiscordWebhookAPI] Got eror (0):

spam console error

this error spam my console

[21:31:13.782] [Server thread/ERROR]: [DiscordWebhookAPI] Got error (404): {"message": "Unknown Webhook", "code": 10015}

Add buttons

the new buttons that discord webhooks offer

nonthreasafevalue

pmmp\thread\NonThreadSafeValueError: "Cannot assign non-thread-safe value of type fynessed\Discord\Webhook to thread-safe class property fynessed\Discord\WebhookSend::$webhook"

NonThreadSafeValueError in PM5

pmmp\thread\NonThreadSafeValueError: "Cannot assign non-thread-safe value of type CortexPE\DiscordWebhookAPI\Webhook to thread-safe class property CortexPE\DiscordWebhookAPI\task\DiscordWebhookSendTask::$webhook" (EXCEPTION) in "plugins/ReportAndSuggest(PM5)/src/CortexPE/DiscordWebhookAPI/task/DiscordWebhookSendTask" at line 43

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.