Guest User

Modals-EmbedBuilder

a guest
Jan 24th, 2026
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. module.exports.run = async function (b, c, cfg, i, a, d) {
  2. var arg = a.split('-');
  3.  
  4. switch (arg[0]) {
  5. case 'Color': {
  6. var color = i.fields.getTextInputValue('color');
  7. i.update({
  8. embeds: [
  9. new b.djs.EmbedBuilder(i.message.embeds[0]).setColor(color)
  10. ],
  11. });
  12. break;
  13. }
  14. case 'Title': {
  15. var title = i.fields.getTextInputValue('title');
  16. i.update({
  17. embeds: [
  18. new b.djs.EmbedBuilder(i.message.embeds[0]).setTitle(title)
  19. ],
  20. });
  21. break;
  22. }
  23. case 'URL': {
  24. var url = i.fields.getTextInputValue('url');
  25. i.update({
  26. embeds: [
  27. new b.djs.EmbedBuilder(i.message.embeds[0]).setURL(url)
  28. ],
  29. });
  30. break;
  31. }
  32. case 'Author': {
  33. var author = i.fields.getTextInputValue('author');
  34. var icon = i.fields.getTextInputValue('icon') || null;
  35. var url = i.fields.getTextInputValue('url') || null;
  36. i.update({
  37. embeds: [
  38. new b.djs.EmbedBuilder(i.message.embeds[0]).setAuthor({ name: author, iconURL: icon, url: url })
  39. ],
  40. });
  41. break;
  42. }
  43. case 'Description': {
  44. var description = i.fields.getTextInputValue('description');
  45. i.update({
  46. embeds: [
  47. new b.djs.EmbedBuilder(i.message.embeds[0]).setDescription(description)
  48. ],
  49. });
  50. break;
  51. }
  52. case 'Thumbnail': {
  53. var thumbnail = i.fields.getTextInputValue('thumbnail');
  54. i.update({
  55. embeds: [
  56. new b.djs.EmbedBuilder(i.message.embeds[0]).setThumbnail(thumbnail)
  57. ],
  58. });
  59. break;
  60. }
  61. case 'Image': {
  62. var image = i.fields.getTextInputValue('image');
  63. i.update({
  64. embeds: [
  65. new b.djs.EmbedBuilder(i.message.embeds[0]).setImage(image)
  66. ],
  67. });
  68. break;
  69. }
  70. case 'Footer': {
  71. var text = i.fields.getTextInputValue('text');
  72. var icon = i.fields.getTextInputValue('icon') || null;
  73. i.update({
  74. embeds: [
  75. new b.djs.EmbedBuilder(i.message.embeds[0]).setFooter({ text: text, iconURL: icon })
  76. ],
  77. });
  78. break;
  79. }
  80. case 'Fields': {
  81. var name = i.fields.getTextInputValue('name');
  82. var value = i.fields.getTextInputValue('value');
  83. var inline = i.fields.getTextInputValue('inline') === 'true';
  84. i.update({
  85. embeds: [
  86. new b.djs.EmbedBuilder(i.message.embeds[0]).addFields({ name, value, inline })
  87. ],
  88. });
  89. break;
  90. }
  91. case 'Content': {
  92. var content = i.fields.getTextInputValue('content');
  93. i.update({ content: content });
  94. break;
  95. }
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment