Skip to content

Commit

Permalink
Fix logging and demo ephemeral messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny2github committed Jan 18, 2021
1 parent 4ebd996 commit accdd9f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions demo_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
@client.slash_cmd()
async def hello(ctx: slash.Context):
"""Hello World!"""
await ctx.respond('Hello World!')
await ctx.respond('Hello World!', flags=slash.MessageFlags.EPHEMERAL,
rtype=slash.InteractionResponseType.ChannelMessage)

@client.slash_group(in_addition=True)
async def say(ctx: slash.Context):
Expand Down Expand Up @@ -63,10 +64,12 @@ async def check_owner(ctx: slash.Context):
discord.Embed(title='You are not the owner!', color=0xff0000)])
return False

token = os.environ['DISCORD_TOKEN'].strip()
logging.basicConfig(handlers=[logging.StreamHandler()])
# show extension logs
logger = logging.getLogger('discord.ext.slash')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())

token = os.environ['DISCORD_TOKEN'].strip()

try:
client.run(token)
Expand Down

0 comments on commit accdd9f

Please sign in to comment.