You can download this code by clicking the button below.
This code is now available for download.
This function randomly selects a guild from a given list of servers and returns it. If the server list is empty, it returns None.
Technology Stack : Discord.py
Code Type : Discord.py Function
Code Difficulty : Intermediate
def get_random_guild(guilds):
import random
if not guilds:
return None
return random.choice(guilds)