Initial commit - Last War messaging system
This commit is contained in:
19
vendor/team-reflex/discord-php/guide/events/application_commands.rst
vendored
Executable file
19
vendor/team-reflex/discord-php/guide/events/application_commands.rst
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
====================
|
||||
Application Commands
|
||||
====================
|
||||
|
||||
|
||||
Application Command Permissions Update
|
||||
======================================
|
||||
|
||||
Called with an ``Overwrite`` object when an application command’s permissions are updated.
|
||||
|
||||
Warning: The class Overwrite will be changed in future version!
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use Discord\Parts\Interactions\Command\Overwrite;
|
||||
|
||||
$discord->on(Event::APPLICATION_COMMAND_PERMISSIONS_UPDATE, function (Overwrite $overwrite, Discord $discord, ?Overwrite $oldOverwrite) {
|
||||
// ...
|
||||
});
|
||||
59
vendor/team-reflex/discord-php/guide/events/auto_moderations.rst
vendored
Executable file
59
vendor/team-reflex/discord-php/guide/events/auto_moderations.rst
vendored
Executable file
@@ -0,0 +1,59 @@
|
||||
================
|
||||
Auto Moderations
|
||||
================
|
||||
|
||||
|
||||
All auto moderation related events are currently only sent to bot users which have the ``MANAGE_GUILD`` permission.
|
||||
|
||||
Auto Moderation Rule Create
|
||||
===========================
|
||||
|
||||
Called with a ``Rule`` object when an auto moderation rule is created.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::AUTO_MODERATION_RULE_CREATE, function (Rule $rule, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::AUTO_MODERATION_CONFIGURATION`` intent.
|
||||
|
||||
Auto Moderation Rule Update
|
||||
===========================
|
||||
|
||||
Called with a ``Rule`` object when an auto moderation rule is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::AUTO_MODERATION_RULE_UPDATE, function (Rule $rule, Discord $discord, ?Rule $oldRule) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Auto Moderation Rule Delete
|
||||
===========================
|
||||
|
||||
Called with a ``Rule`` object when an auto moderation rule is deleted.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::AUTO_MODERATION_RULE_DELETE, function (Rule $rule, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::AUTO_MODERATION_CONFIGURATION`` intent.
|
||||
|
||||
Auto Moderation Action Execution
|
||||
================================
|
||||
|
||||
Called with an ``AutoModerationActionExecution`` object when an auto moderation rule is triggered and an action is executed (e.g. when a message is blocked).
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use `Discord\Parts\WebSockets\AutoModerationActionExecution`;
|
||||
|
||||
$discord->on(Event::AUTO_MODERATION_ACTION_EXECUTION, function (AutoModerationActionExecution $actionExecution, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::AUTO_MODERATION_EXECUTION`` intent.
|
||||
|
||||
132
vendor/team-reflex/discord-php/guide/events/channels.rst
vendored
Executable file
132
vendor/team-reflex/discord-php/guide/events/channels.rst
vendored
Executable file
@@ -0,0 +1,132 @@
|
||||
========
|
||||
Channels
|
||||
========
|
||||
|
||||
|
||||
Requires the ``Intents::GUILDS`` intent.
|
||||
|
||||
Channel Create
|
||||
==============
|
||||
|
||||
Called with a ``Channel`` object when a new channel is created, relevant to the Bot.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::CHANNEL_CREATE, function (Channel $channel, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Channel Update
|
||||
==============
|
||||
|
||||
Called with two ``Channel`` objects when a channel is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::CHANNEL_UPDATE, function (Channel $channel, Discord $discord, ?Channel $oldChannel) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Channel Delete
|
||||
==============
|
||||
|
||||
Called with a ``Channel`` object when a channel relevant to the Bot is deleted.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::CHANNEL_DELETE, function (Channel $channel, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Channel Pins Update
|
||||
===================
|
||||
|
||||
Called with an object when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::CHANNEL_PINS_UPDATE, function ($pins, Discord $discord) {
|
||||
// {
|
||||
// "guild_id": "",
|
||||
// "channel_id": "",
|
||||
// "last_pin_timestamp": ""
|
||||
// }
|
||||
});
|
||||
|
||||
..
|
||||
|
||||
For direct messages, it only requires the ``Intents::DIRECT_MESSAGES`` intent.
|
||||
|
||||
Threads
|
||||
=======
|
||||
|
||||
Requires the ``Intents::GUILDS`` intent.
|
||||
|
||||
Thread Create
|
||||
-------------
|
||||
|
||||
Called with a ``Thread`` object when a thread is created, relevant to the Bot.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::THREAD_CREATE, function (Thread $thread, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Thread Update
|
||||
-------------
|
||||
|
||||
Called with a ``Thread`` object when a thread is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::THREAD_UPDATE, function (Thread $thread, Discord $discord, ?Thread $oldThread) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Thread Delete
|
||||
-------------
|
||||
|
||||
Called with an old ``Thread`` object when a thread relevant to the Bot is deleted.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::THREAD_DELETE, function (?Thread $thread, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Thread List Sync
|
||||
----------------
|
||||
|
||||
Called when list of threads are synced.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::THREAD_LIST_SYNC, function (Collection $threads, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Thread Member Update
|
||||
--------------------
|
||||
|
||||
Called with a Thread ``Member`` object when the thread member for the current Bot is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use Discord\Parts\Thread\Member;
|
||||
|
||||
$discord->on(Event::THREAD_MEMBER_UPDATE, function (Member $threadMember, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Thread Members Update
|
||||
---------------------
|
||||
|
||||
Called with a ``Thread`` object when anyone is added to or removed from a thread. If the Bot does not have the ``Intents::GUILD_MEMBERS``, then this event will only be called if the Bot was added to or removed from the thread.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::THREAD_MEMBERS_UPDATE, function (Thread $thread, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
303
vendor/team-reflex/discord-php/guide/events/guilds.rst
vendored
Executable file
303
vendor/team-reflex/discord-php/guide/events/guilds.rst
vendored
Executable file
@@ -0,0 +1,303 @@
|
||||
======
|
||||
Guilds
|
||||
======
|
||||
|
||||
|
||||
Requires the ``Intents::GUILDS`` intent.
|
||||
|
||||
Guild Create
|
||||
============
|
||||
|
||||
Called with a ``Guild`` object in one of the following situations:
|
||||
|
||||
1. When the Bot is first starting and the guilds are becoming available.
|
||||
2. When a guild was unavailable and is now available due to an outage.
|
||||
3. When the Bot joins a new guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_CREATE, function (Guild $guild, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Update
|
||||
============
|
||||
|
||||
Called with two ``Guild`` objects when a guild is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_UPDATE, function (Guild $guild, Discord $discord, ?Guild $oldGuild) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Delete
|
||||
============
|
||||
|
||||
Called with a ``Guild`` object in one of the following situations:
|
||||
|
||||
1. The Bot was removed from a guild.
|
||||
2. The guild is unavailable due to an outage.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_DELETE, function (object $guild, Discord $discord, bool $unavailable) {
|
||||
// ...
|
||||
if ($unavailable) {
|
||||
// the guild is unavailabe due to an outage
|
||||
// {
|
||||
// "id": "" // guild ID
|
||||
// "unavailable": true
|
||||
// }
|
||||
} else {
|
||||
// the Bot has been kicked from the guild
|
||||
}
|
||||
});
|
||||
|
||||
Guild Bans
|
||||
==========
|
||||
|
||||
Requires the ``Intents::GUILD_BANS`` intent and ``ban_members`` permission.
|
||||
|
||||
Guild Ban Add
|
||||
-------------
|
||||
|
||||
Called with a ``Ban`` object when a member is banned from a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_BAN_ADD, function (Ban $ban, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Ban Remove
|
||||
----------------
|
||||
|
||||
Called with a ``Ban`` object when a user is unbanned from a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_BAN_REMOVE, function (Ban $ban, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Emojis and Stickers
|
||||
=========================
|
||||
|
||||
Requires the ``Intents::GUILD_EMOJIS_AND_STICKERS`` intent.
|
||||
|
||||
Guild Emojis Update
|
||||
-------------------
|
||||
|
||||
Called with two Collections of ``Emoji`` objects when a guild’s emojis have been added/updated/deleted. ``$oldEmojis`` *may* be empty if it was not cached or there were previously no emojis.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_EMOJIS_UPDATE, function (Collection $emojis, Discord $discord, Collection $oldEmojis) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Stickers Update
|
||||
---------------------
|
||||
|
||||
Called with two Collections of ``Sticker`` objects when a guild’s stickers have been added/updated/deleted. ``$oldStickers`` *may* be empty if it was not cached or there were previously no stickers.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_STICKERS_UPDATE, function (Collection $stickers, Discord $discord, Collecetion $oldStickers) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Members
|
||||
=============
|
||||
|
||||
Requires the ``Intents::GUILD_MEMBERS`` intent. This intent is a priviliged intent, it must be enabled in your Discord Bot developer settings.
|
||||
|
||||
Guild Member Add
|
||||
----------------
|
||||
|
||||
Called with a ``Member`` object when a new user joins a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_MEMBER_ADD, function (Member $member, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Member Remove
|
||||
-------------------
|
||||
|
||||
Called with a ``Member`` object when a member is removed from a guild (leave/kick/ban). Note that the member *may* only have ``User`` data if ``loadAllMembers`` is disabled.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_MEMBER_REMOVE, function (Member $member, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Member Update
|
||||
-------------------
|
||||
|
||||
Called with two ``Member`` objects when a member is updated in a guild. Note that the old member *may* be ``null`` if ``loadAllMembers`` is disabled.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_MEMBER_UPDATE, function (Member $member, Discord $discord, ?Member $oldMember) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Roles
|
||||
===========
|
||||
|
||||
Requires the ``Intents::GUILDS`` intent.
|
||||
|
||||
Guild Role Create
|
||||
-----------------
|
||||
|
||||
Called with a ``Role`` object when a role is created in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_ROLE_CREATE, function (Role $role, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Role Update
|
||||
-----------------
|
||||
|
||||
Called with two ``Role`` objects when a role is updated in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_ROLE_UPDATE, function (Role $role, Discord $discord, ?Role $oldRole) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Role Delete
|
||||
-----------------
|
||||
|
||||
Called with a ``Role`` object when a role is deleted in a guild. ``$role`` may return ``Role`` object if it was cached.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_ROLE_DELETE, function (object $role, Discord $discord) {
|
||||
if ($role instanceof Role) {
|
||||
// Role is present in cache
|
||||
}
|
||||
// If the role is not present in the cache:
|
||||
else {
|
||||
// {
|
||||
// "guild_id": "" // role guild ID
|
||||
// "role_id": "", // role ID,
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
Guild Scheduled Events
|
||||
======================
|
||||
|
||||
Requires the ``Intents::GUILD_SCHEDULED_EVENTS`` intent.
|
||||
|
||||
Guild Scheduled Event Create
|
||||
----------------------------
|
||||
|
||||
Called with a ``ScheduledEvent`` object when a scheduled event is created in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_SCHEDULED_EVENT_CREATE, function (ScheduledEvent $scheduledEvent, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Scheduled Event Update
|
||||
----------------------------
|
||||
|
||||
Called with a ``ScheduledEvent`` object when a scheduled event is updated in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_SCHEDULED_EVENT_UPDATE, function (ScheduledEvent $scheduledEvent, Discord $discord, ?ScheduledEvent $oldScheduledEvent) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Scheduled Event Delete
|
||||
----------------------------
|
||||
|
||||
Called with a ``ScheduledEvent`` object when a scheduled event is deleted in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_SCHEDULED_EVENT_DELETE, function (ScheduledEvent $scheduledEvent, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Scheduled Event User Add
|
||||
------------------------------
|
||||
|
||||
Called when a user has subscribed to a scheduled event in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_SCHEDULED_EVENT_USER_ADD, function ($data, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Guild Scheduled Event User Remove
|
||||
---------------------------------
|
||||
|
||||
Called when a user has unsubscribed from a scheduled event in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_SCHEDULED_EVENT_USER_REMOVE, function ($data, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Integrations
|
||||
============
|
||||
|
||||
Requires the ``Intents::GUILD_INTEGRATIONS`` intent.
|
||||
|
||||
Guild Integrations Update
|
||||
-------------------------
|
||||
|
||||
Called with a cached ``Guild`` object when a guild integration is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::GUILD_INTEGRATIONS_UPDATE, function (?Guild $guild, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Integration Create
|
||||
------------------
|
||||
|
||||
Called with an ``Integration`` object when an integration is created in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::INTEGRATION_CREATE, function (Integration $integration, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Integration Update
|
||||
------------------
|
||||
|
||||
Called with an ``Integration`` object when a integration is updated in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::INTEGRATION_UPDATE, function (Integration $integration, Discord $discord, ?Integration $oldIntegration) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Integration Delete
|
||||
------------------
|
||||
|
||||
Called with an old ``Integration`` object when a integration is deleted from a guild. ``$integration`` *may* be ``null`` if Integration is not cached.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::INTEGRATION_DELETE, function (?Integration $integration, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
32
vendor/team-reflex/discord-php/guide/events/index.rst
vendored
Executable file
32
vendor/team-reflex/discord-php/guide/events/index.rst
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
application_commands
|
||||
auto_moderations
|
||||
channels
|
||||
guilds
|
||||
invites
|
||||
interactions
|
||||
messages
|
||||
presences
|
||||
stage_instances
|
||||
voices
|
||||
webhooks
|
||||
|
||||
======
|
||||
Events
|
||||
======
|
||||
|
||||
|
||||
Events are payloads sent over the socket to a client that correspond to events in Discord.
|
||||
|
||||
All gateway events are enabled by default and can be individually disabled using ``disabledEvents`` options. Most events also requires the respective Intents enabled (as well privileged ones enabled from `Developers Portal <https://discord.com/developers/applications>`_) regardless the enabled event setting.
|
||||
|
||||
To listen on gateway events, use the event emitter callback and ``Event`` name constants. Some events are internally handled by the library and may not be registered a listener:
|
||||
|
||||
- ``Event::READY`` (not to be confused with ``'ready'``)
|
||||
- ``Event::RESUMED``
|
||||
- ``Event::GUILD_MEMBERS_CHUNK``
|
||||
|
||||
If you are an advanced user, you may listen to those events before internally handled with the library by parsing the ‘raw’ dispatch event data.
|
||||
|
||||
20
vendor/team-reflex/discord-php/guide/events/interactions.rst
vendored
Executable file
20
vendor/team-reflex/discord-php/guide/events/interactions.rst
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
============
|
||||
Interactions
|
||||
============
|
||||
|
||||
|
||||
Interaction Create
|
||||
==================
|
||||
|
||||
Called with an ``Interaction`` object when an interaction is created.
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use Discord\Parts\Interactions\Interaction;
|
||||
|
||||
$discord->on(Event::INTERACTION_CREATE, function (Interaction $interaction, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Application Command & Message component listeners are processed before this event is called. Useful if you want to create a customized callback or have interaction response persists after Bot restart.
|
||||
|
||||
39
vendor/team-reflex/discord-php/guide/events/invites.rst
vendored
Executable file
39
vendor/team-reflex/discord-php/guide/events/invites.rst
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
=======
|
||||
Invites
|
||||
=======
|
||||
|
||||
|
||||
Requires the ``Intents::GUILD_INVITES`` intent and ``manage_channels`` permission.
|
||||
|
||||
Invite Create
|
||||
=============
|
||||
|
||||
Called with an ``Invite`` object when a new invite to a channel is created.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::INVITE_CREATE, function (Invite $invite, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Invite Delete
|
||||
=============
|
||||
|
||||
Called with an object when an invite is created.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::INVITE_DELETE, function (object $invite, Discord $discord) {
|
||||
if ($invite instanceof Invite) {
|
||||
// Invite is present in cache
|
||||
}
|
||||
// If the invite is not present in the cache:
|
||||
else {
|
||||
// {
|
||||
// "channel_id": "",
|
||||
// "guild_id": "",
|
||||
// "code": "" // the unique invite code
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
124
vendor/team-reflex/discord-php/guide/events/messages.rst
vendored
Executable file
124
vendor/team-reflex/discord-php/guide/events/messages.rst
vendored
Executable file
@@ -0,0 +1,124 @@
|
||||
========
|
||||
Messages
|
||||
========
|
||||
|
||||
|
||||
Unlike persistent messages, ephemeral messages are sent directly to the user and the Bot who sent the message rather than through the guild channel. Because of this, ephemeral messages are tied to the ``Intents::DIRECT_MESSAGES``, and the message object won’t include ``guild_id`` or ``member``.
|
||||
|
||||
Requires the ``Intents::GUILD_MESSAGES`` intent for guild or ``Intents::DIRECT_MESSAGES`` for direct messages.
|
||||
|
||||
Message Create
|
||||
==============
|
||||
|
||||
Called with a ``Message`` object when a message is sent in a guild or private channel.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_CREATE, function (Message $message, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Message Update
|
||||
==============
|
||||
|
||||
Called with two ``Message`` objects when a message is updated in a guild or private channel. The old message may be null if ``storeMessages`` is not enabled *or* the message was sent before the Bot was started. Discord does not provide a way to get message update history.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_UPDATE, function (Message $message, Discord $discord, ?Message $oldMessage) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Message Delete
|
||||
==============
|
||||
|
||||
Called with an old ``Message`` object *or* the raw payload when a message is deleted. The ``Message`` object may be the raw payload if ``storeMessages`` is not enabled *or* the message was sent before the Bot was started. Discord does not provide a way to get deleted messages.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_DELETE, function (object $message, Discord $discord) {
|
||||
if ($message instanceof Message) {
|
||||
// Message is present in cache
|
||||
}
|
||||
// If the message is not present in the cache:
|
||||
else {
|
||||
// {
|
||||
// "id": "", // deleted message ID,
|
||||
// "channel_id": "", // message channel ID,
|
||||
// "guild_id": "" // channel guild ID
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
Message Delete Bulk
|
||||
===================
|
||||
|
||||
Called with a ``Collection`` of old ``Message`` objects *or* the raw payload when bulk messages are deleted. The ``Message`` object may be the raw payload if ``storeMessages`` is not enabled *or* the message was sent before the Bot was started. Discord does not provide a way to get deleted messages.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_DELETE_BULK, function (Collection $messages, Discord $discord) {
|
||||
foreach ($messages as $message) {
|
||||
if ($message instanceof Message) {
|
||||
// Message is present in cache
|
||||
}
|
||||
// If the message is not present in the cache:
|
||||
else {
|
||||
// {
|
||||
// "id": "", // deleted message ID,
|
||||
// "channel_id": "", // message channel ID,
|
||||
// "guild_id": "" // channel guild ID
|
||||
// }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Message Reactions
|
||||
=================
|
||||
|
||||
Requires the ``Intents::GUILD_MESSAGE_REACTIONS`` intent for guild or ``Intents::DIRECT_MESSAGE_REACTIONS`` for direct messages.
|
||||
|
||||
Message Reaction Add
|
||||
--------------------
|
||||
|
||||
Called with a ``MessageReaction`` object when a user added a reaction to a message.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_REACTION_ADD, function (MessageReaction $reaction, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Message Reaction Remove
|
||||
-----------------------
|
||||
|
||||
Called with a ``MessageReaction`` object when a user removes a reaction from a message.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_REACTION_REMOVE, function (MessageReaction $reaction, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Message Reaction Remove All
|
||||
---------------------------
|
||||
|
||||
Called with a ``MessageReaction`` object when all reactions are removed from a message. Note that only the fields relating to the message, channel and guild will be filled.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_REACTION_REMOVE_ALL, function (MessageReaction $reaction, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Message Reaction Remove Emoji
|
||||
-----------------------------
|
||||
|
||||
Called with an object when all reactions of an emoji are removed from a message. Unlike Message Reaction Remove, this event contains no users or members.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::MESSAGE_REACTION_REMOVE_EMOJI, function (MessageReaction $reaction, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
44
vendor/team-reflex/discord-php/guide/events/presences.rst
vendored
Executable file
44
vendor/team-reflex/discord-php/guide/events/presences.rst
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
=========
|
||||
Presences
|
||||
=========
|
||||
|
||||
|
||||
Presence Update
|
||||
===============
|
||||
|
||||
Called with a ``PresenceUpdate`` object when a member’s presence is updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::PRESENCE_UPDATE, function (PresenceUpdate $presence, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::GUILD_PRESENCES`` intent. This intent is a priviliged intent, it must be enabled in your Discord Bot developer settings.
|
||||
|
||||
Typing Start
|
||||
============
|
||||
|
||||
Called with a ``TypingStart`` object when a user starts typing in a channel.
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use Discord\Parts\WebSockets\TypingStart;
|
||||
|
||||
$discord->on(Event::TYPING_START, function (TypingStart $typing, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::GUILD_MESSAGE_TYPING`` intent.
|
||||
|
||||
User Update
|
||||
===========
|
||||
|
||||
Called with a ``User`` object when the Bot’s user properties change.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::USER_UPDATE, function (User $user, Discord $discord, ?User $oldUser) {
|
||||
// ...
|
||||
});
|
||||
|
||||
40
vendor/team-reflex/discord-php/guide/events/stage_instances.rst
vendored
Executable file
40
vendor/team-reflex/discord-php/guide/events/stage_instances.rst
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
===============
|
||||
Stage Instances
|
||||
===============
|
||||
|
||||
|
||||
Requires the ``Intents::GUILDS`` intent.
|
||||
|
||||
Stage Instance Create
|
||||
=====================
|
||||
|
||||
Called with a ``StageInstance`` object when a stage instance is created (i.e. the Stage is now “live”).
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::STAGE_INSTANCE_CREATE, function (StageInstance $stageInstance, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Stage Instance Update
|
||||
=====================
|
||||
|
||||
Called with a ``StageInstance`` objects when a stage instance has been updated.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::STAGE_INSTANCE_UPDATE, function (StageInstance $stageInstance, Discord $discord, ?StageInstance $oldStageInstance) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Stage Instance Delete
|
||||
=====================
|
||||
|
||||
Called with a ``StageInstance`` object when a stage instance has been deleted (i.e. the Stage has been closed).
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::STAGE_INSTANCE_DELETE, function (StageInstance $stageInstance, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
33
vendor/team-reflex/discord-php/guide/events/voices.rst
vendored
Executable file
33
vendor/team-reflex/discord-php/guide/events/voices.rst
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
======
|
||||
Voices
|
||||
======
|
||||
|
||||
|
||||
Voice State Update
|
||||
==================
|
||||
|
||||
Called with a ``VoiceStateUpdate`` object when a member joins, leaves or moves between voice channels.
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use Discord\Parts\WebSockets\VoiceStateUpdate;
|
||||
|
||||
$discord->on(Event::VOICE_STATE_UPDATE, function (VoiceStateUpdate $state, Discord $discord, $oldstate) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::GUILD_VOICE_STATES`` intent.
|
||||
|
||||
Voice Server Update
|
||||
===================
|
||||
|
||||
Called with a ``VoiceServerUpdate`` object when a voice server is updated in a guild.
|
||||
|
||||
.. code:: php
|
||||
|
||||
// use Discord\Parts\WebSockets\VoiceServerUpdate;
|
||||
|
||||
$discord->on(Event::VOICE_SERVER_UPDATE, function (VoiceServerUpdate $guild, Discord $discord) {
|
||||
// ...
|
||||
});
|
||||
|
||||
18
vendor/team-reflex/discord-php/guide/events/webhooks.rst
vendored
Executable file
18
vendor/team-reflex/discord-php/guide/events/webhooks.rst
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
========
|
||||
Webhooks
|
||||
========
|
||||
|
||||
|
||||
Webhooks Update
|
||||
===============
|
||||
|
||||
Called with a ``Guild`` and ``Channel`` object when a guild channel’s webhooks are is created, updated, or deleted.
|
||||
|
||||
.. code:: php
|
||||
|
||||
$discord->on(Event::WEBHOOKS_UPDATE, function (?Guild $guild, Discord $discord, ?Channel $channel) {
|
||||
// ...
|
||||
});
|
||||
|
||||
Requires the ``Intents::GUILD_WEBHOOKS`` intent.
|
||||
|
||||
Reference in New Issue
Block a user