'Button to copy text in Python available for everyone

I'm making a Discord bot and, to make the UX better, I made a button that allows users to copy the value of an embed's field. I tested the code on my computer and the text gets copied, but as soon as I tried to click the button from my phone, the text didn't get copied.

Is there a way to render this button working on every Discord client (computer's clients and mobile's clients)?

However, the code I used is this

from pyperclip import *

@ui.button(label="Copy ID", emoji="📋", style=ButtonStyle.green, custom_id="copy_id")
async def copy_id(self, button: ui.Button, interaction: Interaction):
    id = interaction.message.embeds[0].fields[4].value

    copy(id[1:-1])


Solution 1:[1]

The module you are using for sending text to the clipboard is not maintained anymore (here is their github).

I believe (from this post) that the module Clipboard of Kivy may solve your problem. As of now, it support Python 3.7 to 3.10.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cfgn