Jere's Techblog

Create Discord Bot

I way toying arround with Discord and Python because I wanted to record the messages and reactions of users.
Therefore I wrote a bot with the library My first attempts with Python…or let’s say a try and error session….

But in the end I was able toget the reactions and log messages.

below some good references and instructions and an example of my discord bot


Installation of Python 3.5<

Python Discord API –

py -3 -m pip install -U

Python await –

pip install await

Python async –

pip install async




My own Bot

import discord
from discord.ext import commands

client = commands.Bot(command_prefix='.')

async def on_ready():
   #a = discord.utils.get(client.get_all_members(),name="Test-User", discriminator="9635").id  #GetUserID
    print('Bot is ready.')

"""  crawl message
async def on_message(message):
    if str( == 'Test-user#111':
         print(f'{message.content} RECEIVED!.')
        print(f'{message.content} wrong User!.')

#get reaction an log it on another channel crawl message with some condition as an example
async def on_reaction_add(reaction, user):
    channel = client.get_channel(6637461198)
    if str( == '579155970803':
        if str( != '57915597803':
            await channel.send('[{0.display_name}] -  {0} has reacted with {1.emoji}!; ID = {} '.format(user, reaction))' some API-DiscordServer String here ')
Continue reading...