Skip to content
Encourage Bot
BeauCarnes
BeauCarnes
This Repl has no description
260comments
pouyayazdani
pouyayazdani
2 days ago

not worked for me

Yuelin202020
Yuelin202020
4 weeks ago

keep_alive( ) is a little error

gaeaf
gaeaf
1 month ago

@client
.event is showing an eof error

LabidiOmar
LabidiOmar
2 months ago

if message.content.stratswith("%hello"): the error say AttributeError: 'str' object has no attribute 'stratswith please help

CLRDaily
CLRDaily
2 months ago

Traceback (most recent call last): File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/ TOKEN=OTYzMTg5MDU1MDYxODg1MDU4.YlSdtQ.8mRKRG3CmHW7AGdvHOK0lZm4qp0 Traceback (most recent call last): File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/http.py", line 300, in static_login data = await self.request(Route('GET', '/users/@me')) File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/http.py", line 254, in request raise HTTPException(r, data) discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "main.py", line 22, in client.run(os.getenv('token')) File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/client.py", line 723, in run return future.result() File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/client.py", line 702, in runner await self.start(*args, **kwargs) File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/client.py", line 665, in start await self.login(*args, bot=bot) File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/client.py", line 511, in login await self.http.static_login(token.strip(), bot=bot) File "/home/runner/helper-bot/venv/lib/python3.8/site-packages/discord/http.py", line 304, in static_login raise LoginFailure('Improper token has been passed.') from exc discord.errors.LoginFailure: Improper token has been passed.

procoder00
procoder00
3 months ago

sleepy boi

herloc
herloc
3 months ago

This tutorial really helped me getting through the first steps of the bot, but sadly most of the code is outdated. If you still aim to use this bot as a learning experiences for future students, perhaps you should update it? Either way, this bot taught me a lot about programming bots in general and for that I am very thankful! =)

31-NguyenNguyen
31-NguyenNguyen
3 months ago

Dude its not working

ZakZCraftZ
ZakZCraftZ
4 months ago

how do u do the keepalive cause it aint working for me

ameliofragnce
ameliofragnce
5 months ago

from flask import Flask from threading import Thread

app = Flask('')

@app
.route('/') def home(): return "Hello. I am alive!"

def run(): app.run(host='0.0.0.0',port=8080)

def keep_alive(): t = Thread(target=run) t.start()

VJag
VJag
5 months ago

Why is it not waking up????

annamariaaievol
annamariaaievol
6 months ago
SohamBiswas2
SohamBiswas2
7 months ago

Wake up repl

vien-sieu-pham
vien-sieu-pham
7 months ago

trouble?

AppuTheLabrador
AppuTheLabrador
7 months ago

um its sleeping

DellWithGaming
DellWithGaming
7 months ago

This is super outdated recommend just using the repl.it tutorial; much more clear.

ShreyashPatil1
ShreyashPatil1
7 months ago

On line 19 There is this message: Traceback (most recent call last): File "Path of where the project is stored", line 19, in if "responding" not in db.keys(): AttributeError: 'NoneType' object has no attribute 'keys'

Conan-kunKun
Conan-kunKun
7 months ago

bruh stop sleeping repl

TusharVerma6
TusharVerma6
7 months ago

Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "main.py", line 80, in on_message index = int(msg.split("$del", 1)[1]) IndexError: list index out of range I am getting this error whenever i type a command

BTT-GamingGamin
BTT-GamingGamin
7 months ago

stop sleeping

dalbirp3
dalbirp3
8 months ago

stop sleeping repl >:(

AngelesGuadarra
AngelesGuadarra
8 months ago

Line 59 it says this: File "main.py", line 59 await message.channel.send(random.choice(options))

SyntaxError: invalid syntax

The arrow is pointing at await

Its the same code as the video anyone know how to fix this?

FRGaming1
FRGaming1
8 months ago

if anyone had the issue "TypeError: can only concatenate list (not "str") to list", try adding list when assigning the db to variables like: awesome = list(db["awesomeness"]) options = options + list(db["awesomeness"])

petersonkayden7
petersonkayden7
8 months ago

Hi

REDSHOTGAMER
REDSHOTGAMER
8 months ago

Help me it showing await an outside function

albert1033
albert1033
8 months ago

depressed

Khairel-IrfanIr
Khairel-IrfanIr
8 months ago

lol

D0C70RD00M
D0C70RD00M
8 months ago

Die

KhanterW
KhanterW
9 months ago

So I do come to realize that I do not want random answers but predefined. so in both lists (I call them dictionary) I want to associate one word with other, so if person say for example "Honor", bot would answer "Honour". I seen this before in RedBot Cogs, but I do not like Redbot, and uses Javascript. How could I define this on Python?

ScaryKim
ScaryKim
9 months ago

Hi Guys, I have an error in my code that is like this:

Ignoring exception in on_message Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "main.py", line 60, in on_message options = options + db["encouragements"] TypeError: can only concatenate list (not "ObservedList") to list

I can fix this error by doing this options = options + list(db["encouragements"])

But what is "ObservedList"? The first time I ever met this error and I don't know what it is

KranosCode
KranosCode
9 months ago

full bugs

96tahir
96tahir
10 months ago

Hey I have fixed this code (September 11, 2021) you can view it in my profile or my github: https://github.com/96tahir/discordbot

amongusfunnies
amongusfunnies
10 months ago

if len(ez_message) > index I get invalid syntax

MSMOfficial
MSMOfficial
10 months ago

Okay

DesanduRanathun
DesanduRanathun
10 months ago

Where should I import TOKEN?

Edvinas55yt
Edvinas55yt
10 months ago

I think it's out of date.

darldhfchfnbc
darldhfchfnbc
10 months ago

this is a nice discord bot! i did it and i have a discord bot! thanks

NeelabhBanskota
NeelabhBanskota
10 months ago

nice

KentTran2
KentTran2
10 months ago

If anyone is getting errors with options = options + db["encouragements"]

Try replacing it with: options = options.extend(db["encouragements"])

And if that doesn't work try: options += db["encouragements"]

sniffyN
sniffyN
11 months ago

i have a problem running the command inspire as it gives me an error(ignoring exception in on_message & string indices must be integers), any help?

MrSpace123
MrSpace123
11 months ago

How do I create the .env?

SmartSlendy
SmartSlendy
11 months ago

File "main.py", line 63, in on_message await message.channel.send(random.choice(options)) File "/usr/lib/python3.8/random.py", line 288, in choice i = self._randbelow(len(seq)) TypeError: object of type 'NoneType' has no len()

anyone has this issue?

helppp i dont know how

code-noob
code-noob
11 months ago

thx for the tutorial

DangVietHoang
DangVietHoang
11 months ago

thank's for the tutorial

pidroYT
pidroYT
11 months ago

awesome tutorial

tausif-5135
tausif-5135
11 months ago

hi there i have an issue, i saw ur tutorial and here now .env in replit doesn't exist, now what should I do??

EagleGamingYTGa
EagleGamingYTGa
11 months ago

Hey

Qula-FnFn
Qula-FnFn
11 months ago

hi

legendscript
legendscript
11 months ago

how to run bot in python

XTNOM
XTNOM
11 months ago

nice bot

banana8224
banana8224
11 months ago

trash, doesnt even work. needed a real pro to help me out.

LewisYoung1
LewisYoung1
11 months ago

Hi

PracticalNPC
PracticalNPC
11 months ago

Great job with this tutorial!

For line 60, I had to replace options = options + db["encouragements"] with options = options.extend(db["encouragements"])

theypaidno
theypaidno
1 year ago

"WARNING: This is a development server. Do not use it in a production deployment." - Uptime Robot Will this be an issue, once our bot crosses 100+ servers and reaches the verification stage.

hsanghorbel
hsanghorbel
1 year ago

sad

NiamulhHqe
NiamulhHqe
1 year ago

Hey guys seen many people need help in many cases! join this server for help - https://discord.gg/xDvwKKrqv6

ishicinnamanbun
ishicinnamanbun
1 year ago

i am trying to work on making a bot and it says 'TOKEN' is not recognized does anybody know what to do?

mattmcmullen20
mattmcmullen20
1 year ago

Don't follow this guys youtube video he codes super wrong this is not how your supposed to do it

maputiro
maputiro
1 year ago

So when doing the get_quote function it doesn't seem to return the quote and instead a memory address e.g <function get_quote at 0x7fb4ff222550>

eykorgb
eykorgb
1 year ago

how do you make the.env file

TheGenocide
TheGenocide
1 year ago

Noice ome

dakshya2020
dakshya2020
1 year ago

ok

mechibo06
mechibo06
1 year ago

[SolverProblemError] Because replit (3.0.0) depends on flask (>=1.1.2,<2.0.0) and no versions of replit match >3.0.0,<4.0.0, replit (>=3.0.0,<4.0.0) requires flask (>=1.1.2,<2.0.0). So, because repl-python3-botibo2 depends on both replit (^3.0.0) and flask (^2.0.0), version solving failed. exit status 1 Repl.it: Package operation failed.

Hello guys, I have a problem like tihs. Could someone help me?

yMarcius
yMarcius
1 year ago

Ignoring exception in on_message Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "main.py", line 58, in on_message options = options + db["encouragements"] TypeError: can only concatenate list (not "ObservedList") to list

mityakuz2308
mityakuz2308
1 year ago

for some reason the lines

if message.content.startswith('!hi'): await message.channel.send('hi')

dont work for me, please help

santoshreddy5
santoshreddy5
1 year ago

whenever, I try to delete a encouraging messsage $del 0 the following ObservedList(value=[]) has been appearing in my server instead of showing what got deleted which should be something like this ['You are amazing.', 'You are so amazing and cool.'] . did any encounter this type of situation ? can you please help how to solve this ?

fs0c13ty
fs0c13ty
1 year ago

The quote part is not working anymore for some reason.. it doesn't return any error but it doesn't return a quote either when I type "$inspire"; I copied that part of the code from here to make sure and It still didn't work.

Hanlise
Hanlise
1 year ago

still confused with the data base part

esakhan123098
esakhan123098
1 year ago

Some reason on line 47 main.py it says i get a syntax error

mevsolo
mevsolo
1 year ago

Hi Beau! Thank you for the tutorial, it was super helpful and I learned a lot from your video! I have been trying to create my own version of the bot using the Evil Insult Generator, but I have no idea how to implement it here to this code. https://evilinsult.com/api/ any advise would really help!

showtell4
showtell4
1 year ago

When I type $list I see this: ObservedList(value=['You are amazing.', 'You are so amazing and cool.', 'You are the doing great, keep your head up!'])

instead of just: ['You are amazing.', 'You are so amazing and cool.', 'You are the doing great, keep your head up!']

any tips to help fix this?

ShushrutGupta
ShushrutGupta
1 year ago

Okay, those guys who cant get their tokens correct, first go left bar and click on lock icon [Secrets(Environment Variables)]. it will ask for token name and key. Paste the copied key in key section and give token name as TOKEN(you can choose any name here). after that it import os and add the following line client.run(os.environ['TOKEN']) It will work

WeMod
WeMod
1 year ago

File .env?

PamelaChevrier
PamelaChevrier
1 year ago

Not working ... :( I even copied/pasted the code to work out any human error (changing TOKEN to mine), but it ain't running no more.

Reaper008
Reaper008
1 year ago

Can you tell me how to replace .env files

miropetrov
miropetrov
1 year ago

File "main.py", line 81, in on_message options = options + db["encouragements"] UnboundLocalError: local variable 'options' referenced before assignment

AaronNicholas26
AaronNicholas26
1 year ago

Hello BeauCarnes! This Project is awesome Sir any ideas can you give so that I can develop this code more. May be some modifications .

Yours Sincerely, A Aaron Nicholas

balugafish
balugafish
1 year ago

can someone help please?

if message.author == client.user:

if message.author == client.user: ^

the "i" is not connecting with the rest of the code

TechySkills
TechySkills
1 year ago

How to fix this error? Do anyone have any idea? I need Urgent Help!

Ignoring exception in on_message Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event await coro(*args, **kwargs) File "main.py", line 58, in on_message if db["responding"]: File "/opt/virtualenvs/python3/lib/python3.8/site-packages/replit/database/database.py", line 434, in getitem raw_val = self.get_raw(key) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/replit/database/database.py", line 474, in get_raw raise KeyError(key) KeyError: 'responding'

lxmawo
lxmawo
1 year ago

can o get some help,. my bot not replying when i say hello to him, im already trying to changing the word but its not working :(((

Niamul
Niamul
1 year ago

Really like your tutorial and code. Thank you so much to you and freecodecamp. (This is not a self ad. Because this is not my server. I have an error. after joining this server they solve it and by this server I started to make new customize bots. Join it if you have any problemo: https://discord.gg/V8HpbEuEtK )

KeanMarollano
KeanMarollano
1 year ago

I wanted a discord bot very much but this one didn't worked so many errors :(

KeanMarollano
KeanMarollano
1 year ago

I tried this and It doesn't work even once

deathman12
deathman12
1 year ago

help i keep on getting this error: Traceback (most recent call last): File "main.py", line 4, in Client = discord.client() TypeError: 'module' object is not callable

Maple7000
Maple7000
1 year ago

File "main.py", line 60, in on_message options = options + db["encouragements"] TypeError: can only concatenate list (not "ObservedList") to list

what happened?

JackTheThe1
JackTheThe1
1 year ago

hello, does anyone know how to make it mention the user and if so can you edit the script then reply the edited code link to me?

Jajaakka
Jajaakka
1 year ago

hi , how do i make a bot join a vc ? If someone could help me, that would be great!

epicly
epicly
1 year ago

Hey guys! Also another question, does any1 have an idea on how to make a rock paper scissors command?

epicly
epicly
1 year ago

there is also no error code

epicly
epicly
1 year ago

hi, how do i add a second command to a bot? i added one command, and it worked fine, I added another command, and that command does not work. If someone could help me, that would be awesome! ; D

JoelBinu
JoelBinu
1 year ago

Hello Can Someone Help Me At The Hello Code I Am Getting Syntax Error

DanishSethi
DanishSethi
1 year ago

Working so good

Dark77
Dark77
1 year ago

$hi

AstronomicalTV
AstronomicalTV
1 year ago

Why I can't see the HTTP tab when I run the program???

DepthStrider03
DepthStrider03
1 year ago

yes yes yes yes yes this is amazzzzzzzinnnnnnnnnnnnnngggggggggggggg

laidellent
laidellent
1 year ago

thank you.

AndersonZC
AndersonZC
1 year ago

Awesome tutorial, thank you so much!

Icebear223
Icebear223
1 year ago

Can anyone help me for the first part of the coding, everytime I try to run the bot it says a little orange thing