generate functionSun, 13 Nov 2022

Roll a random number between one and twenty. Send the results to discord via webhook.

import random from discord_webhook import DiscordWebhook url = 'https://discordapp.com/api/webhooks/736847544163975168/Pma-ACnr6Fz1KjD_6NgJ6wYU6jWZ6oQP9R9-6lQz6sWjxHx1FnTNiTJ3qj8W_eBmvRAR' hook = DiscordWebhook(url=url) def roll(): roll_result = random.randint(1, 20) hook.send(content = "You rolled a " + str(roll_result)) roll()

Questions about programming?Chat with your personal AI assistant