You can download this code by clicking the button below.
This code is now available for download.
This function randomly returns a greeting when a message is received.
Technology Stack : Discord.py
Code Type : Function
Code Difficulty : Intermediate
import discord
import random
def create_random_greeting(message):
# This function creates a random greeting when a message is received.
greetings = ["Hello!", "Hi there!", "Hey!", "Greetings!", "What's up?"]
return random.choice(greetings)
# Code Information