Copying messages from Discord server to another Discord

Hey everyone, hope y’all are having a nice day.
I’m still learning integration with Pipedream and more. I wanted to ask for help and hopefully someone from this community will give me some of their time.
I want to copy all the previous messages from my one Discord server to my other Discord server. I tried some things but didn’t work. Can anyone please tell me how to perform this, if possible with steps? Sorry for being a novice.

Hi @zqa9,

To copy messages from one Discord server to another, you can create a Pipedream workflow with a Discord trigger and action. Here’s a high-level overview of the steps:

  1. Create a new Pipedream workflow with a “Discord — New Message (Instant)” trigger. Connect your Discord account and follow the instructions on the trigger configuration screen.

  2. Add a “Discord — Send Message” action to your workflow. Connect your Discord account again (for the destination server) and configure the action to send the message content from the trigger step.

Here’s an example Pipedream component for the “Send Message” action:

export default defineComponent({
  props: {
    discord: {
      type: "app",
      app: "discord",
    },
    channelId: {
      type: "string",
      label: "Destination Channel ID",
    },
  },
  async run({ steps, $ }) {
    const messageContent = steps.trigger.event.content;

    // Use the Send Message action from the Discord app
    await this.discord.sendMessage({
      channel_id: this.channelId,
      content: messageContent,
    });
  },
});

Replace channelId with the ID of the destination channel in your other Discord server. You can find the channel ID by enabling Developer Mode in Discord settings and then right-clicking the channel to copy its ID.

Please note that this workflow will only copy messages sent after the workflow is activated. It won’t copy previous messages from before the workflow was active.
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.

I’ve deployed a workflow sending live messages, but is there any way for old messages to be copied to another server?