mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[V3 Dev] Fix mock command (#1156)
This commit is contained in:
parent
a53f284c88
commit
50c9e7767d
@ -4,6 +4,7 @@ import io
|
|||||||
import textwrap
|
import textwrap
|
||||||
import traceback
|
import traceback
|
||||||
from contextlib import redirect_stdout
|
from contextlib import redirect_stdout
|
||||||
|
from copy import copy
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@ -286,17 +287,11 @@ class Dev:
|
|||||||
|
|
||||||
The prefix must not be entered.
|
The prefix must not be entered.
|
||||||
"""
|
"""
|
||||||
# Since we have stateful objects now this might be pretty bad
|
msg = copy(ctx.message)
|
||||||
# Sorry Danny
|
msg.author = user
|
||||||
old_author = ctx.author
|
msg.content = ctx.prefix + command
|
||||||
old_content = ctx.message.content
|
|
||||||
ctx.message.author = user
|
|
||||||
ctx.message.content = ctx.prefix + command
|
|
||||||
|
|
||||||
await ctx.bot.process_commands(ctx.message)
|
ctx.bot.dispatch('message', msg)
|
||||||
|
|
||||||
ctx.message.author = old_author
|
|
||||||
ctx.message.content = old_content
|
|
||||||
|
|
||||||
@commands.command(name="mockmsg")
|
@commands.command(name="mockmsg")
|
||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user