-
Notifications
You must be signed in to change notification settings - Fork 11
Usage
DiscoCloner is a Discord bot that can clone channels and roles from one server to another. This bot is created by ghalbeyou and the source code can be found on GitHub.
-
Import the
discord
library in your Python code:import discord
-
Create an instance of the bot using the
Client
class and specify the desired intents:bot = discord.Client(intents=discord.Intents.all())
-
Prompt for the bot token and command prefix from the user:
bot_token = input('Enter your Discord bot token: ') prefix = input('Enter the command with prefix that you want to use to copy server(!test or $start): ') or "$start"
-
Define the
on_ready()
event handler to be triggered when the bot is ready to start:@bot.event async def on_ready(): print('Logged on as', bot.user.name) print('Welcome to the DiscoCloner!') print('This bot is created by ghalbeyou (https://github.com/ghalbeyou)') print('Bot token has been provided and the bot is ready to start.\nYou can read documents in the main GitHub page: https://github.com/ghalbeyou')
-
Define the
on_message()
event handler to be triggered when a message is sent in a server:@bot.event async def on_message(message: discord.Message): # Check if the message is from the bot itself to avoid an infinite loop if message.author == bot.user: return # Check if the message is a command to start the channel and role copying process if message.content.startswith(prefix): # Get the source server ID and destination server ID from the console source_server_id = message.author.guild.id destination_server_id = input('Enter the Destination server ID (123456789): ') # Fetch the source server and destination server objects source_server = bot.get_guild(int(source_server_id)) destination_server = bot.get_guild(int(destination_server_id)) # Rest of the code for cloning channels and roles print('\nClone was successfully done. Thanks for using this repo. Make sure to give it a star ;)')
-
Run the bot using the
run()
method with the bot token:bot.run(token=bot_token)
For more information and detailed usage instructions, please refer to the GitHub repository of DiscoCloner.
If you would like to contribute to DiscoCloner, you can fork the repository, make changes, and submit a pull request. Contributions are always welcome!
If you encounter any issues while using DiscoCloner, you can try the following troubleshooting steps:
-
Bot not logging in: Double-check the bot token you entered and ensure it is valid.
-
Incorrect command prefix: Verify that you have provided the correct command prefix in the
prefix
variable. -
Intents not enabled: Make sure you have enabled all the necessary intents using
discord.Intents.all()
when creating the bot instance. -
Missing library: If you encounter an error related to a missing library, make sure you have imported the
discord
library in your Python code. -
Invalid server IDs: Double-check that you are entering valid server IDs for the source and destination servers.
-
Permissions issues: Ensure that the bot has the necessary permissions in both the source and destination servers.
-
GitHub repository issues: Report any issues related to the GitHub repository of DiscoCloner to the repository owner on GitHub.
-
Python version compatibility: Make sure you are using a compatible version of Python with DiscoCloner.
-
Firewall or network issues: Check your network settings and ensure that the bot has proper internet access to connect to Discord's API.
If you encounter any other issues, you can refer to the GitHub repository or documentation for DiscoCloner for further troubleshooting steps or seek help from the community.
DiscoCloner | Created by ghalbeyou | GitHub