Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

bot delete embed py

@commands.command(name='hug', pass_context=True, aliases=['hugs'])
    @commands.cooldown(5, 60, commands.BucketType.user)
    async def hug(self, context, member: discord.Member):
        """Hug your friend"""
        author = context.message.author.mention
        mention = member.mention

        hug = "{0} hugs {1}"

        choices = ['example.gif']

        image = random.choice(choices)

        embed = discord.Embed(description=hug.format(author, mention), colour=discord.Color(random.randint(0x000000, 0xFFFFFF)))
        embed.set_image(url=image)

        await self.bot.say(embed=embed)
        await asyncio.sleep(3) 
        await self.bot.delete_message(embed)
Comment

PREVIOUS NEXT
Code Example
Python :: pyspark filter column in list 
Python :: how to sort dictionary in ascending order by sorted lambda function in python 
Python :: pandas difference between two dataframes 
Python :: how to test value error in pytest in python 
Python :: for char in string python 
Python :: deleting an object in python 
Python :: DIVAB Solution 
Python :: np.hstack in python 
Python :: what is python -u 
Python :: sep and end in print python 
Python :: check django channels with redis setup 
Python :: python server 
Python :: heroku python heroku port issue 
Python :: pandas grid subplots 
Python :: load specific columns dataframe 
Python :: remove a first array of item in python 
Python :: No installed app with label 
Python :: python check date between two dates 
Python :: tqdm spamming 
Python :: API curl python pandas 
Python :: python test class hashable 
Python :: telegram.ext 
Python :: k fold CV with xgboost 
Python :: sklearn grid search show progress 
Python :: pyspark parquet to dataframe 
Python :: pairwise combinations groupby 
Python :: django base path on level up 
Python :: python unicode function 
Python :: symbolic variables python 
Python :: python Python Program to Catch Multiple Exceptions in One Line 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =