First of all, i want to know if/how i can bind this bot event to a specific channel or a specific role so this can just be executed by this role in this channel:
async def on_message(message):
if content.message.startswith('!Beispiel')
(return)
Also i want to know why my bot doesnt answer with this code:
import asyncio
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix = "!")
client = discord.Client()
@bot.command()
async def temprole(ctx, role_time : int, member: discord.Member=None, role: discord.Role = None):
if not member:
await ctx.send("Who do you want me to give a role?")
return
role = discord.utils.get(ctx.guild.roles, name="muted")
await member.add_roles(role)
await ctx.send("Ok, I did it :thumpsup:")
if role is None:
return await self.bot.say('Pls write a role')
await asyncio.sleep(role_time)
await member.remove_roles(role)
await ctx.send("The time of the role of {} is up".format(member))
@bot.command()
async def test(ctx, arg):
await ctx.send(arg)
client.run(' ')
becuase im typing in !test hello or !temprole or so and it doesnt answer :/