-
Find the Discord channel in which you would like to send commits and other updates
-
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
import discord | |
from discord.ext import commands | |
def insert_returns(body): | |
# insert return stmt if the last expression is a expression statement | |
if isinstance(body[-1], ast.Expr): | |
body[-1] = ast.Return(body[-1].value) |