I wanted to try my hand at making a discord bot however I'm running into an issue where my bot will not come online. I've tried 2 different codes I've found from internet tutorials but neither of them will make the bot appear online or do anything. I've seen someone ask a similar question on here using a similar code to what I have implemented and was currently working with and said that their issues were coming from a certificate error (Discord Bot not coming online) but I'm not sure how I would go about resolving it. For context I'm using Python 3.9
on PyCharm
and my code looks like this (I have used an actual token but I've heard its not good to give that out) :
import discord
from discord.ext import commands
client = commands.Bot(command_prefix='.')
@client.event
async def on_ready():
print('bot is ready')
client.run('TOKEN')
Please ask if you need any more information that what I've already provided.
edit1:pycharm says that the import 'import discord' is unused is that why im having issues?
edit2:I have tried using the following command to get the bot to do something but it is still not working-
@client.event
async def ping(ctx):
await ctx.send('pong!')