« first day    last day (352 days later) » 

12:13 AM
@Ann @Vic I just posted my bot's Winter Bash hat on that post.
0
A: Show off your hats! (2020 Edition)

TechBOTTech BOT has some funny hair that helps he/she/it/script/bot fly through all of the MSE chatrooms and drop some eggs which will become chat messages ;D

Check it out :)
 
nice
 
@Ann Thanks for upvoting! I just need @Vic to upvote it and then my bot'll have enough rep to chat here :)
@Ann I've just added you as one of the room owners :)
 
@TechExpertWizard I'm sorry, but please don't make assumptions :)
 
 
2 hours later…
2:14 AM
@Ann Seems like there's already been 2 upvotes. Now I can run my bot :)
@The I'll add you as a room owner if you admit that I am the King of Shadow's Den and this Den as well ;D
@Ann It sure is hard trying to suggest edits to work your way to 20 rep :( It's unfortunate you didn't know that you were going to make a chatbot that needed 20 rep, and you posted a Winter Bash hat answer there before you knew you were going to make a chatbot :(
 
 
2 hours later…
4:36 AM
@VictorVosMottor I tried this code, but it gave me:
Traceback (most recent call last):
  File "C:/Users/wil/Desktop/chatbot.py", line 7, in <module>
    room.join()
  File "C:\Users\wil\AppData\Local\Programs\Python\Python37\lib\site-packages\chatexchange\rooms.py", line 51, in join
    return self._client._join_room(self.id)
  File "C:\Users\wil\AppData\Local\Programs\Python\Python37\lib\site-packages\chatexchange\client.py", line 279, in _join_room
    self._br.join_room(room_id)
  File "C:\Users\wil\AppData\Local\Programs\Python\Python37\lib\site-packages\chatexchange\browser.py", line 246, in join_room
 
 
6 hours later…
10:50 AM
@AnnZen It'e probably because of permissions of room. Make sure that your bot account has enough rep and the room is opened ;)
 
 
2 hours later…
12:54 PM
@Ann Is your bot working now?
 
no, I still have the error...
 
@Ann Could you please give us (me and @Vic) your bot's code? Thanks!
 
from chatexchange.client import Client
email = "secret stuff"
password = "secret stuff"
se_chat = Client("stackexchange.com")
se_chat.login(email, password)
room = se_chat.get_room('1542')
room.join()
room.send_message('hi guys!')
room.leave()
 
@Ann You need to change stackexchange.com to meta.stackexchange.com to make it work 'cause this room is on MSE chat, not SE chat. Did you remember @Vic said that room 1542 was already closed on SE chat?
 
oh, let me try
 
1:00 PM
hi guys!
 
@Ann That's great! Your bot's working!
 
^
 
@Ann Congrats :)
 
Thanks.
Can you tell me how to detect messages?
 
1:22 PM
from chatexchange.client import Client
email = "email@email.com"
password = "**************"
se_chat = Client("stackexchange.com")
se_chat.login(email, password)
def on_event(event, _):
    msg = event.message.content_source
    if msg == 'say hi':
        room.send_message('Hi!')
room = se_chat.get_room('number')
room.join()
room.send_message('hi guys!')
while True:
    pass
 
@VictorVosMottor What's the _ in the on_event function?
 
1:42 PM
I dunno ;D
I didn't use it
 
I have
from chatexchange.client import Client
email = "********"
password = "********"
se_chat = Client("meta.stackexchange.com")
se_chat.login(email, password)
room = se_chat.get_room('1542')
room.join()

def on_event(event, _):
msg = event.message.content_source
if msg == 'say hi':
room.send_message('Hi!')
room = se_chat.get_room('number')
room.join()
room.send_message('hi guys!')
while True:
pass

room.leave()
But it returns
Traceback (most recent call last):
  File "C:/Users/wil/Desktop/chatbot.py", line 14, in <module>
    room.join()
  File "C:\Users\wil\AppData\Local\Programs\Python\Python37\lib\site-packages\chatexchange\rooms.py", line 51, in join
    return self._client._join_room(self.id)
  File "C:\Users\wil\AppData\Local\Programs\Python\Python37\lib\site-packages\chatexchange\client.py", line 279, in _join_room
    self._br.join_room(room_id)
  File "C:\Users\wil\AppData\Local\Programs\Python\Python37\lib\site-packages\chatexchange\browser.py", line 244, in join_room
Do you know what went wrong? Thanks!
 
change number to id ;D
this room is 1542
see url
@ann
 
Oh. Do you know how to call the on_event function?
 
what do you mean?
;)
@ann
from chatexchange.client import Client
email = "email@email.com"
password = "**************"
se_chat = Client("stackexchange.com")
se_chat.login(email, password)
def on_event(event, _):
    msg = event.message.content_source
    if msg == 'say hi':
        room.send_message('Hi!')
room = se_chat.get_room('1542')
room.join()
room.send_message('hi guys!')
while True:
    pass
 
Well, the function is defined, but nowhere is it called.
 
1:52 PM
just run this code and you will see ^
ah stop
I'm sorry
you need to do it this way:
from chatexchange.client import Client
email = "email@email.com"
password = "**************"
se_chat = Client("stackexchange.com")
se_chat.login(email, password)
def on_event(event, _):
    msg = event.message.content_source
    if msg == 'say hi':
        room.send_message('Hi!')
room = se_chat.get_room('1542')
room.join()
room.send_message('hi guys!')
room.watch_socket(on_event)
while True:
    pass
like this ^
@Ann
 
hi guys!
 
say hi
errrrrrrr
 
I get AttributeError: 'UserEntered' object has no attribute 'message'
 
ah I see
I had the same
Here's how to fix
from chatexchange.client import Client
email = "email@email.com"
password = "**************"
se_chat = Client("stackexchange.com")
se_chat.login(email, password)
def on_event(event, _):
    try:
        msg = event.message.content_source
        if msg == 'say hi':
            room.send_message('Hi!')
    except:
        pass
room = se_chat.get_room('1542')
room.join()
room.send_message('hi guys!')
room.watch_socket(on_event)
while True:
    pass
@ann
There's two ways to fix it
this one ^
and using events
@ann
 
hi guys!
 
1:56 PM
say hi
 
hi
 
Hi!
 
I can't say hi again...
hi
now I can
hi
 
1:57 PM
Hi!
 
it works with "say hi"
it is hardcoded in code
> if msg == 'say hi':
room.send_message('Hi!')
@ann
 
hi
 
@AnnZen what are you trying to do? ;)
 
Testing to see if I get a response every time.
hi
 
@AnnZen It responses to "say hi" not to just hi
see
say hi
 
2:00 PM
Hi!
hi guys!
Hi!
 
Hi!
 
@ann yeah ;D
 
The bot responded to its one hi.
 
Hi!
 
2:01 PM
I mean own
 
show me your code
 
hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
 
Hi!
 
I know what caused it, it was intentional :)
 
2:02 PM
ah startswith I guess ;)
 
Now if only the bandaid didn't have to be there...
 
what do you mean?
 
The try - except
 
ah yeah
You can do it another way
Using events
Gimme a minute I'll show it
 
hi guys!
 
2:05 PM
Hi!
 
Hi!
 
doesn't work(((
minute plz
 
hi guys!
 
Hi!
 
2:07 PM
@VosMottor'sBot hi
 
hi guys!
 
Hi!
 
hi guys!
 
Hi!
 
2:09 PM
Hi!
 
from chatexchange.client import Client
email = "*****"
password = "****"
se_chat = Client("meta.stackexchange.com")
se_chat.login(email, password)
def on_event(event, _):
    if event.data['event_type'] == 1:
        msg = event.message.content_source
        if msg == 'say hi':
            room.send_message('Hi!')

room = se_chat.get_room('1542')
room.join()
room.send_message('hi guys!')
room.watch_socket(on_event)
while True:
    pass
 
Hi!
 
@AnnBOT tpu-
 
hi guys!
 
@ann that's how to use events
1 is msg sent
 
2:11 PM
@VictorVosMottor Thank you very very much! I need to go for now, bye :D
 
yw ;D
bye ;)
 
2:29 PM
Hey @Vic! Why ain't you talkin' to me anymore? I haven't even finished makin' my bot, so you should really start talkin' to me ;D
 
hi guys!
 
Hi!
 
@Vic @Ann My bot's workin' too, and I don't need to get frustrated when Python raises an error, 'cause you've already worked that part out ;D
say hi
 
2:46 PM
@TechExpertWizard Hi!
gimme your code and error
 
@Vic I haven't gotten any errors actually :)
 
hi guys!
 
@Vic Try playing with my bot!
tb hi
 
Hi!
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
2:57 PM
tb help
tb alive
tb coffee
tb anything
tb hi
@Tech run it please
tb hi
say hi
 
 
4 hours later…
6:49 PM
@Vic I was busy at the time and I couldn't run the bot. I'll run the Python script now.
 
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
tb alive
 
No need to worry, I'm alive.
 
tb coffee
 
Brewing a cup of lungo coffee.
 
6:51 PM
tb hi
 
Hi!
 
@Vic I've temporarily stopped the bot. I'm going to start it a few minutes later.
 
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
tb say what
 
what
 
6:58 PM
tb say This seems a bit strange.
 
This seems a bit strange.
 
tb say This bot's great!
 
This bot's great!
 
@Vic This is how you play with my chatbot. I might add a tea command later this afternoon, but for now, this is already great :) However, unfortunately, I need to stop the Python script 'cause I need to restart my computer for updates :( I'll run the bot once the updates finish. Thank you for your patience.
 
tb coffeee
tb alive
tb say alive
tb say hey?
 
7:37 PM
@VictorVosMottor Can you tell me how to detect different users with the bot? I'd also like a link to the tutorial you mention. Thanks :)
 
7:51 PM
@Vic Sorry, I stopped the bot at that time, I'm going to bring it back in now.
in Shadow's Den, 1 min ago, by Tech Expert Wizard
@Ann It ain't really a tutorial, it's just basically a few chat messages in Discord where he taught me how to create an SE chatbot, and he's actually taught you more than that tutorial, which was only sort of a tutorial ;D
 
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
@Ann How 'bout bringin' your bot in as well? That'd be great :)
tb coffee
 
Brewing a cup of cappucino coffee.
 
tb alive
 
No need to worry, I'm alive.
 
7:52 PM
tb say Hello!
 
Hello!
 
tb hello
tb hi
 
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
Hi!
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
tb alive
tb coffee
tb hi
tb hello
tb help
tb say ["text"]
 
8:05 PM
@TechExpertWizard still in development :)
 
8:34 PM
Hi everyone!
Hiya!
Hey!
 
You know what chatexchange.browser.LoginError: failed to get acct` cookie from Stack Exchange OpenID, check credentials provided for accuracy` means?
 
Hi everyone!
What's up?
Hi everyone!
 
 
1 hour later…
9:41 PM
Hi everyone!
Hiya!
What's up?
Hi everyone!
What's up?
Hi everyone!
Hey!
 
testing
 
Hi everyone!
Hi!
Hiya!
Hiya!
Hiya!
Hi everyone!
Hi!
 
9:58 PM
Hi everyone!
 
hi
 
Hi everyone!
 
hi
hello?
 
Hi everyone!
 
ji
 
10:05 PM
Hi everyone!
Hi everyone!
 
hi
 
Hiya!
 
now
 
Hiya!
 
ko
 
10:12 PM
Hiya!
 
lll
 
Hiya!
 
cat
 
Hiya!
 
hoiikiguk
 
10:19 PM
Hiya!
 
@AnnBOT Thanks for keeping lonely ol'me company.
 
Hi!
 
@Ann No offence, but what can your bot do right now, 'cept sayin' hi and hiya? P.S. Try my bot!
 
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
what
@AnnZen When did you get that error? Could you please give me your code?
@Ann Are you there?
@AnnBOT hoiikiguk
@AnnZen Hey, wanna play with my chatbot?
 
10:44 PM
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
Hello! I'm Tech BOT, and my owner is Tech Expert Wizard.
 
11:32 PM
@TechExpertWizard ok
@TechExpertWizard hoiikiguk
@TechExpertWizard not at that time
@TechExpertWizard The error comes inconsistently, sometimes it comes, other times it doesn't.
@TechExpertWizard nnnnnnnnnnnnnnnnnnothing!
 

« first day    last day (352 days later) »