Different bots can be created, which can then be accessed by other plugins.
Questions and Answers
How do I create a Bot?
Go to ACP -> Configuration -> Discord -> Discord Bots -> Add Discord-Bot.
How can I implement to my Plugin?
Add the dependency to this plugin to your package.xml::
Code
<requiredpackage minversion="1.0.0">dev.hanashi.wsc.discord-api</requiredpackage>
Create a bot in the ACP. This gets an ID. Using the following code you can use the API:
Code
$discord = wcf\system\discord\DiscordApi::getApiByID($botID);
The $botID has to be changed, of course.
Now you can communicate with Discord. Here is an example to get a channel:
Code
$discord->getChannel($channelID);
-
Version 2.5.1
- Hanashi
- 44 kB
- 29 Downloads
Changes
- Typed properties are no longer initialized with null
- correct usage of unserialize
- simple style adjustments
bug fixes
- PHP deprecation fixed
-
Version 2.5.0
- Hanashi
- 43.74 kB
- 6 Downloads
New features
- Discord Message Flags have been added
- DiscordSelectOptionType can now specify a maximum number of channels across all servers
Improvements
- SQL-ANSI standard
- EventHandler in DiscordInteractionAction reworked, the old ones are now deprecated
- comments in the Database Objects added
- the DiscordSelectOptionType was visually reworked
- channel types are now cached for 10 seconds to avoid rate limits
bug fixes
- the Interaction Endpoint Url in the ACP was wrong
- missing language variables for Color Option Type were added
- no webhooks were created in a channel if a webhook was already created by another bot
-
Version 2.4.0
- Hanashi
- 42.73 kB
- 11 Downloads
Changes
- Embed color type has been rebuilt
- there is a new disord interaction class with events
- importHelpers were set to true
- the button to connect once in the ACP was removed, it only caused confusion
- the option type DiscordBotMultiSelectOptionType was reworked
-
Version 2.3.0
- Hanashi
- 326.14 kB
- 5 Downloads
New features
- the multiple channel list in the ACP is now filterable
- a configuration wizard has been added to support the creation of a bot
- the options DiscordWebhookChannelMultiSelectOptionType and DiscordChannelMultiSelectOptionType now support the extra information channeltypes to filter for specific channel types
Improvements
- template formatting has been unified
- the open source license was added to package.xml
bug fixes
- in the last version types for application command were removed by mistake, they were added again
-
Version 2.2.0
- Hanashi
- 279.55 kB
- 11 Downloads
- FEATURE: new Application Command API functions
- FEATURE: new Auto Moderation API functions
- FEATURE: new Forum API functions
- FEATURE: addition of existing API functions
-
Version 2.1.1
- Hanashi
- 273.92 kB
- 48 Downloads
- FIX: Embed Color Option had problems in live mode
-
Version 2.1.0
- Hanashi
- 273.92 kB
- 8 Downloads
- FEATURE: Added methods for stickers
- FEATURE: Added methods for Scheduled Events
- FEATURE: Added method for crosspost
- FEATURE: Added DiscordEmbedColorOptionType
-
Version 2.0.4
- Hanashi
- 261.12 kB
- 21 Downloads
- FIX: resolves installation problem with primary key
-
Version 2.0.3
- Hanashi
- 262.66 kB
- 18 Downloads
- CHANGE: number of characters for prefix increased to 100
- CHANGE: removed unnecessary uses
-
Version 2.0.2
- Hanashi
- 261.63 kB
- 38 Downloads
- FIX: Problem fixed when an OptionType is used multiple times
-
Tolle gut dokumentierte API
- TitusKirch
- 1.0.2
Diese Erweiterung ist toll und gut dokumentiert, genau wie man es von Hanashi's Erweiterungen gewohnt ist.
Denden111
Ich habe es nicht so mit Discord, für meine Communty ist derzeit ein Plan, Das von Kalender Termine in denn Termin Channel im Discord gepostet werden soll, ich hatte angenommen das ich das mit einem Discord bot machen kann.
Leider stoße ich auf Probleme denn Bot in denn Discord einzubauen.
Wozu soll Bot-Token dienen?
Und warum findet der Bot obwohl Server ID angabe keinen Zugriff auf denn Discord Server?
Denden111
auch was mir nicht klar ist, wie ich ein Webhook erstellen kann.
Hanashi Author
Hallo,
mglw. werden deine Fragen durch ein Blick in mein FAQ bereits beantwortet
https://hanashi.dev/faq-question-list/