Skip to content

Commit

Permalink
feat: add context_menu command (#485)
Browse files Browse the repository at this point in the history
* feat: add context command

* fix: add context command

* fix: add type checking

* fix: add name user and image

Now in context menu commands show the user name and user image used command

* fix: change command context

* Update index.html

* Removing margin

* Fix: margin

* feat: add "profile" to contexr user

I add method "profile" to user context alike the user profile

* fix: Changing the profile

* Add My profile

* Add My profile

* Update index.js

* Adding other profiles

I re-added the profiles that I accidentally removed

* Adding message

I re-added the messages that I accidentally removed

* fix: message thread

When I added the context menu command I accidentally changed the thread opening message

* Removing the "default-value" in modal

* Add message icon

* add user and message command

* fixing my stupidities

* add more commands type

* Adding unintentionally removed message

* fix: Correcting attribute names and more

I corrected the attribute names and added the server user and official app to the "message_command"

* fix: add new type users context

* fix: Correctiing name command

* fix: Correcting avatar of official appliication

* fix: Correcting property description
  • Loading branch information
eumarciel404 authored Oct 19, 2024
1 parent 3750abf commit 1f853cc
Show file tree
Hide file tree
Showing 4 changed files with 383 additions and 5 deletions.
128 changes: 127 additions & 1 deletion packages/core/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,20 +449,88 @@ <h3 class="title">Replies in Compact Mode</h3>
<h3 class="title">Commands</h3>
<discord-messages>
<discord-message profile="skyra">
<discord-command slot="reply" profile="favna" command="ping"></discord-command>
<discord-command type="slash_command" slot="reply" profile="favna" command="ping"></discord-command>
Pong!
</discord-message>
<discord-message profile="skyra" ephemeral>
<discord-reply slot="reply" profile="skyra" command>Pong!</discord-reply>
Took 100ms.
</discord-message>
<discord-message profile="skyra">
<discord-command
type="user_command"
context-user-profile="favna"
slot="reply"
profile="marciel404"
command="user"
></discord-command>
The user is Favna!
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
context-user-profile="skyra"
context-message-reply="The user is Favna!"
context-command-reply
slot="reply"
profile="marciel404"
command="content message"
></discord-command>
The content is "The user is Favna!"
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
context-user-profile="favna"
context-message-reply="This is nice message!"
slot="reply"
profile="marciel404"
command="content message"
></discord-command>
The content is "This is nice message!"
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
profile="marciel404"
context-user-application-official
context-user-name="Updates for the community"
context-message-reply="This channel has been set up to receive official Discord announcements..."
slot="reply"
command="content message"
></discord-command>
This channel has been set up to receive official Discord announcements...
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
profile="marciel404"
context-user-server
context-user-name="IVM"
context-user-image="https://cdn.discordapp.com/icons/1101694285839077537/0572af3a3447d536d63f58ede8827dd9.png?size=2048"
context-message-reply="I'm the best server in discord"
slot="reply"
command="content message"
></discord-command>
I'm the best server in discord
</discord-message>
</discord-messages>
<h3 class="title">Commands with deleted message</h3>
<discord-messages>
<discord-message profile="skyra">
<discord-reply slot="reply" deleted></discord-reply>
Took 100ms.
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
context-message-deleted
slot="reply"
profile="marciel404"
command="content message"
></discord-command>
The content is "The user is Favna!"
</discord-message>
</discord-messages>
<h3 class="title">Commands in Compact Mode</h3>
<discord-messages compact-mode>
Expand All @@ -474,6 +542,64 @@ <h3 class="title">Commands in Compact Mode</h3>
<discord-reply slot="reply" profile="skyra" command>Pong!</discord-reply>
Took 100ms.
</discord-message>
<discord-message profile="skyra">
<discord-command
type="user_command"
context-user-profile="favna"
slot="reply"
profile="marciel404"
command="user"
></discord-command>
The user is Favna!
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
context-user-profile="skyra"
context-message-reply="The user is Favna!"
context-command-reply
slot="reply"
profile="marciel404"
command="content message"
></discord-command>
The content is "The user is Favna!"
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
context-user-profile="favna"
context-message-reply="This is nice message!"
slot="reply"
profile="marciel404"
command="content message"
></discord-command>
The content is "This is nice message!"
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
profile="marciel404"
context-user-application-official
context-user-name="Updates for the community"
context-message-reply="This channel has been set up to receive official Discord announcements..."
slot="reply"
command="content message"
></discord-command>
This channel has been set up to receive official Discord announcements...
</discord-message>
<discord-message profile="skyra">
<discord-command
type="message_command"
profile="marciel404"
context-user-server
context-user-name="IVM"
context-user-image="https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/skyralounge.gif"
context-message-reply="I'm the best server in discord"
slot="reply"
command="content message"
></discord-command>
I'm the best server in discord
</discord-message>
</discord-messages>
<h3 class="title">Components</h3>
<discord-messages>
Expand Down
5 changes: 5 additions & 0 deletions packages/core/demo/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
globalThis.$discordMessage = {
profiles: {
marciel404: {
author: 'marciel404',
avatar: 'https://github.com/eumarciel404.png',
roleColor: '#00ffff'
},
maximillian: {
author: 'Maximillian Osborn',
avatar: 'https://raw.githubusercontent.com/skyra-project/discord-components-implementations/main/shared/public/avaone.png',
Expand Down
Loading

0 comments on commit 1f853cc

Please sign in to comment.