@bot.check
async def global_guild_only(ctx):
if not ctx.guild:
raise commands.NoPrivateMessage # replicating guild_only check: https://github.com/Rapptz/discord.py/blob/42a538edda79f92a26afe0ac902b45c1ea20154d/discord/ext/commands/core.py#L1832-L1846
return True
@bot.command()
@commands.guild_only()
async def cmd(ctx, ...):
"""Here we go..."""
...