2021-12-02

I'm making a Discord Ghostpinger bot in Python

The part that prints out every message does work and it can see messages properly, but it never sends a response (the !ghostping doesn't work). I'm quite new to Phyton tho so it's a possibility that I am just dumb, thank you if you check it out though <3

import time
import discord



TOKEN = ('don't token log my bot pls the token is here btw')

client = discord.Client()

@client.event
async def on_ready():
    print(f'{client.user} has connected to Discord!')




@client.event
async def on_message(message):
    full_message = str(message.content)
    user_message = str(message.content).split('!ghostping')[0]
    channel = str(message.channel.name)
    username = str(message.author).split('#')[0]
    print(f'{username}: {str(message.content)} ({channel})')

    if message.author == client.user:
        return

    if message.channel.name == 'teszt':
        if str(message.content.lower).startswith('!ghostping'):
         await message.channel.send(f'@{user_message}') #this part doesn't work
         time.sleep(1)
         await ctx.message.delete()
         return


client.run(TOKEN)


from Recent Questions - Stack Overflow https://ift.tt/32G69eG
https://ift.tt/eA8V8J

No comments:

Post a Comment