Advertisement
samiroexpikachu

Zombie

Feb 14th, 2024 (edited)
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. const valentine = {
  2. name: "zombie",
  3. version: "1.0",
  4. author: "Samir Œ",
  5. countDown: 5,
  6. role: 0,
  7. shortDescription: {
  8. en: "Image to zombie"
  9. },
  10. longDescription: {
  11. en: "Image to zombie"
  12. },
  13. category: "AI",
  14. guide: {
  15. en: "{pn} reply to image"
  16. }
  17. };
  18.  
  19.  
  20. const samirxrichi = async ({ api, event }) => {
  21. const imageLink = event.messageReply?.attachments[0]?.url;
  22. if (!imageLink) {
  23. return api.sendMessage('Please reply to an image.', event.threadID, event.messageID);
  24. }
  25.  
  26. try {
  27. const apiUrl = `https://apis-samir.onrender.com/zombie?imgurl=${encodeURIComponent(imageLink)}`;
  28. const imageStream = await global.utils.getStreamFromURL(apiUrl);
  29. if (!imageStream) {
  30. return api.sendMessage('Failed to animate the image.', event.threadID, event.messageID);
  31. }
  32. return api.sendMessage({ attachment: imageStream }, event.threadID, event.messageID);
  33. } catch (error) {
  34. console.log(error);
  35. return api.sendMessage('Failed to animate the image.', event.threadID, event.messageID);
  36. }
  37. };
  38.  
  39. module.exports = {
  40. config: valentine ,
  41. onStart: samirxrichi,
  42. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement