def user_ban(channel, user):
"""
Creates an embed UI containing an user warning message
Args:
channel (discord.Channel): The Discord channel to bind the embed to
user (discord.User): The user to ban
Returns:
ui (ui_embed.UI): The embed UI object
"""
username = user.name
if isinstance(user, discord.Member):
if user.nick is not None:
username = user.nick
# Create embed UI object
gui = ui_embed.UI(
channel,
"Banned {}".format(username),
"{} has been banned from this server".format(username),
modulename=modulename
)
return gui
评论列表
文章目录