Re: PyTeamTalk

2020-09-02 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: PyTeamTalk

I don't know why you have check as a parameter. Right now it doesn't do anything useful.As a general rule of thumb, reserve arguments for data that is apt to change.No need for:g = server.get_user(u["userid"])You can eliminate a step by just calling:server.user_message(u["userid"], nickname + " writes to  you:\n" + content[1:])Note that I also changed "content[1]" to "content[1:]". Without this, if there was an "@" in your message for some reason, it along with everything else would be dropped. Look into Python slices to understand why.

URL: https://forum.audiogames.net/post/566495/#p566495




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-09-02 Thread AudioGames . net Forum — Developers room : jonikster via Audiogames-reflector


  


Re: PyTeamTalk

@camlorn,Thank you, I'll take that next time.

URL: https://forum.audiogames.net/post/566425/#p566425




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-09-01 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: PyTeamTalk

Catching all errors is bad.  There are other sorts of errors.  Maybe the internet went away and it's no longer connected.  maybe you divided by zero.  Maybe you called a method that doesn't exist.  Every time Python shows you an error in the shell it's an exception, including even syntax errors when importing modules.  If you catch all errors, you catch these as well.  it's too much.  This is what I mean by swallowing.  Python will silently eat them and you never see it and the program will be like "You screwed up but this exception block is catching everything so obviously that means teamtalk didn't find the object".  You need to only catch what you're interested in and let it crash and show you the rest.

URL: https://forum.audiogames.net/post/566282/#p566282




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-09-01 Thread AudioGames . net Forum — Developers room : jonikster via Audiogames-reflector


  


Re: PyTeamTalk

@camlorn,About decorators, the only thing I understand is that there is a function inside which it is defined that I can add something there. And the decorator adds this to the function.I created this with an example from source code.About try, but why! If so it catches all errors.

URL: https://forum.audiogames.net/post/566261/#p566261




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-09-01 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: PyTeamTalk

@9Have you tried googling Python decorator tutorial? I'd start there.  Your code looks broadly right at least with respect to the decorator however.Try to be more specific with your exceptions. except: is bad. except SpecificExceptionClassHere: is better.  You want exceptions that aren't the one you want to handle to not get caught so that you can see how it broke, otherwise the errors will just silently get swallowed.

URL: https://forum.audiogames.net/post/566252/#p566252




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-09-01 Thread AudioGames . net Forum — Developers room : jonikster via Audiogames-reflector


  


Re: PyTeamTalk

Hello.I don't know decorators very well.The documentation says that I can use:t.subscribe("messagedeliver", message)But how can I use this?I'd like to have a bot that sends messages to the user by nickname. To do this, I need to send 2 messages. Nick and message.But I don't know how to do this in a decorator, or without them.I have developed in one message. It works, but please look if it's developed correctly. How could I improve this?Thanks in advance.import teamtalkt = teamtalk.TeamTalkServer("audio-club.net", 10334)@t.subscribe("messagedeliver")def message(server, params, check=False):    user = server.get_user(params["srcuserid"])    if params["type"] == teamtalk.USER_MSG:        nickname = user["nickname"]        content = params["content"]        if not "@" in content:            server.user_message(user, "Sorry. What do you want from me?")            return        content = content.split("@")        try:            for u in server.users:                if u['nickname'] == content[0]:                    check = True                    g = server.get_user(u["userid"])                    server.user_message(g, nickname + " writes to  you:\n" + content[1])                    print(nickname + " sending message to " + content[0] + ": " + content[1])                    server.user_message(user, "Message has been sent")            if check == False:                            server.user_message(user, "I don't see such.")        except:            server.user_message(user, "I don't see such")            returnt.connect()t.login("Bot", "", "", "TeamTalkBotClient")t.handle_messages()

URL: https://forum.audiogames.net/post/566204/#p566204




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-29 Thread AudioGames . net Forum — Developers room : haily_merry via Audiogames-reflector


  


Re: PyTeamTalk

Hey, fantastic work, and for sure something I'll be tinkering with.

URL: https://forum.audiogames.net/post/565550/#p565550




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-29 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: PyTeamTalk

I would really like to see this get put on Pypi at some point too.

URL: https://forum.audiogames.net/post/565548/#p565548




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-29 Thread AudioGames . net Forum — Developers room : Simter via Audiogames-reflector


  


Re: PyTeamTalk

I really like this thing. I am right now trying to create bots that introduce admin commands on teamtalk like /ban, /kick and so on, and will publish these on github soon.

URL: https://forum.audiogames.net/post/565547/#p565547




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-29 Thread AudioGames . net Forum — Developers room : Patrick via Audiogames-reflector


  


Re: PyTeamTalk

CD into the directory it is in, and type "pip install ."

URL: https://forum.audiogames.net/post/565446/#p565446




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-29 Thread AudioGames . net Forum — Developers room : Remi via Audiogames-reflector


  


Re: PyTeamTalk

hi therewhenever I run one of the examples. it says that it can't find a module named teamtalk. how do I fix this?

URL: https://forum.audiogames.net/post/565425/#p565425




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


PyTeamTalk

2020-08-28 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


PyTeamTalk

Hey folks,For those who haven't entirely moved away from TeamTalk, lately I've been having some fun interfacing with the undocumented text (TCP) API.More specifically, making bots, tools for administrators, automated scripts... Whatever comes to mind. The result is an easy-to-use event driven Python wrapper.If you're new to the language, this could be a good way to get your hands dirty. If you have half an hour and an idea or two, creating something is easy.The repository contains a couple examples one can use to get on their feet. There is also a fully functional Spotify controller on my github. I have a basic prototype for a Youtube (among a bunch of other sites) controller, still working out a couple kinks with youtube-dl and streaming however.I've seen a surprising number of others on here making stuff too.Check it out here. If you have questions don't hesitate to ask or submit an issue.Have fun!

URL: https://forum.audiogames.net/post/565318/#p565318




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-28 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: PyTeamTalk

Oh yay. Now we can make things like discord bots, but for TeamTalk. LOLS.

URL: https://forum.audiogames.net/post/565329/#p565329




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: PyTeamTalk

2020-08-28 Thread AudioGames . net Forum — Developers room : Patrick via Audiogames-reflector


  


Re: PyTeamTalk

For sure an interesting tool. I use it sometimes, but the only thing I made was a bot that just gives you a random number when you send it the word random. Plan to do something more useful soon.

URL: https://forum.audiogames.net/post/565324/#p565324




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


PyTeamTalk

2020-08-28 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


PyTeamTalk

Hey folks,For those who haven't entirely moved away from TeamTalk, lately I've been having some fun interfacing with the undocumented text (TCP) API.More specifically, making bots, tools for administrators, automated scripts... Whatever comes to mind. The result is an easy-to-use event driven Python wrapper.If you're new to the language, this could be a good way to get your hands dirty. If you have half an hour and an idea or two, creating something is easy.The repository contains a couple examples one can use to get on their feet. There is also a fully functional Spotify controller on my github. I have a basic prototype for a Youtube (among a bunch of other sites) controller, still working out a couple kinks with youtube-dl and streaming however.I've seen a surprising number of others making stuff too.Check it out here. If you have questions don't hesitate to ask or submit an issue.Have fun!

URL: https://forum.audiogames.net/post/565318/#p565318




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


PyTeamTalk

2020-08-28 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


PyTeamTalk

Hey folks,For those who haven't entirely moved away from TeamTalk, lately I've been having some fun interfacing with the undocumented text (TCP) API.More specifically, making bots, tools for administrators, automated scripts... Whatever comes to mind. The result is an easy-to-use event driven Python wrapper.If you're new to the language, this could be a good way to get your hands dirty. If you have half an hour and an idea or two, creating something is easy.The repository contains a couple examples one can use to get on their feet. There is also a fully functional Spotify Controller on my github. I have a basic prototype for a Youtube (among a bunch of other sites) controller, still working out a couple kinks with youtube-dl and streaming however.I've seen a surprising number of others making stuff too.Check it out here. If you have questions don't hesitate to ask them hear or submit an issue.Have fun!

URL: https://forum.audiogames.net/post/565318/#p565318




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


PyTeamTalk

2020-08-28 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


PyTeamTalk

Hey folks,For those who haven't entirely moved away from TeamTalk, lately I've been having some fun interfacing with the undocumented text (TCP) API.More specifically, making bots, tools for administrators, automated scripts... Whatever comes to mind. The result is an easy-to-use event driven Python wrapper.If you're new to the language, this could be a good way to get your hands dirty. If you have half an hour and an idea or two, creating something is easy.The repository contains a couple examples one can use to get on their feet, in addition to a fully functional Spotify Controller on my github. I have a basic prototype for a Youtube (among a bunch of other sites) controller, still working out a couple kinks with youtube-dl and streaming however.I've seen a surprising number of others making stuff too.Check it out here. If you have questions don't hesitate to ask them hear or submit an issue.Have fun!

URL: https://forum.audiogames.net/post/565318/#p565318




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector