cortexpe / discordwebhookapi Goto Github PK
View Code? Open in Web Editor NEWA PocketMine-MP Virion to easily send messages via Discord Webhooks
License: GNU Lesser General Public License v3.0
A PocketMine-MP Virion to easily send messages via Discord Webhooks
License: GNU Lesser General Public License v3.0
How to read discord messages from discord members?
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 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
...
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.
How to set new line on the measage
Hey can you add that files can be sent via Webhook? theoretically it is possible
https://discord.com/developers/docs/resources/webhook#execute-webhook
Can you add support for PM4?
Send message discord to in-game, if the operator sends a message via discord it will send a message to players on the server
[DiscordWebhookAPI] Got eror (0):
this error spam my console
[21:31:13.782] [Server thread/ERROR]: [DiscordWebhookAPI] Got error (404): {"message": "Unknown Webhook", "code": 10015}
the new buttons that discord webhooks offer
Please Update To PM4
pmmp\thread\NonThreadSafeValueError: "Cannot assign non-thread-safe value of type fynessed\Discord\Webhook to thread-safe class property fynessed\Discord\WebhookSend::$webhook"
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
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.