@bot.command()
async def message_role(ctx, role: discord.Role,message: str):
for member in ctx.message.guild.members:
if role in member.roles:
member = ctx.author
await bot.member.send(message)
for member in role.members:
await member.send(message)