mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Updated examples to use new properties.
This commit is contained in:
parent
7258a9e700
commit
6b12ef2a0c
@ -5,8 +5,8 @@ client = discord.Client()
|
||||
@client.async_event
|
||||
def on_member_join(member):
|
||||
server = member.server
|
||||
fmt = 'Welcome {0} to {1.name}!'
|
||||
yield from client.send_message(server, fmt.format(member.mention(), server))
|
||||
fmt = 'Welcome {0.mention} to {1.name}!'
|
||||
yield from client.send_message(server, fmt.format(member, server))
|
||||
|
||||
@client.async_event
|
||||
def on_ready():
|
||||
|
@ -9,8 +9,8 @@ def on_message(message):
|
||||
return
|
||||
|
||||
if message.content.startswith('!hello'):
|
||||
msg = 'Hello {}!'.format(message.author.mention()
|
||||
yield from client.send_message(message.channel, msg))
|
||||
msg = 'Hello {0.author.mention}'.format(message)
|
||||
yield from client.send_message(message.channel, msg)
|
||||
|
||||
@client.async_event
|
||||
def on_ready():
|
||||
|
Loading…
x
Reference in New Issue
Block a user