Make a Discord Bot with Python (Part 8: Tic Tac Toe) | Two Players, Commands, and Error Handlers

  Рет қаралды 33,426

Robotic Nation

Robotic Nation

3 жыл бұрын

*IMPORTANT CODE UPDATE*
I have made a few changes to this code that took care of some frequent errors. After watching the video, please make sure you use the updated code from my GITHUB (linked below).
In this video, you’ll learn how to create a Tic Tac Toe Bot using Python. Using this bot you will be able to play Tic Tac Toe against other people in your server. We also go over how to incorporate commands and error handlers into your bot, which makes the code more robust. This project is definitely more advanced than my other tutorials, so I hope you find it helpful. If you enjoyed this project, please considering leaving a like and subscribing!
GitHub Code github.com/afazio1/robotic-na...
A lot of people seem to find this series helpful, so I am continuing with it. Btw check out my other discord bot tutorials below.
Discord Bot Series • Discord Bot Python Series
Need help with your bot? Or just want to have a chat? Join my discord server!
Invite Link / discord
⥊Social Media
Instagram / robotic.nation
Twitch / robotic_nation
⥊Free Code Editors
PyCharm www.jetbrains.com/pycharm/
Sublime Text www.sublimetext.com/
Visual Studio Code code.visualstudio.com/
#DiscordBot #DiscordPy #TicTacToe

Пікірлер: 159
@jacob-jm2xp
@jacob-jm2xp 3 жыл бұрын
I just sat down and was wondering what to code today, perfect timing!
@GlowyDragon_
@GlowyDragon_ 3 жыл бұрын
Love your videos. the speed is not too fast and you actually explain everything you do so Im left with no questions. Keep it up!
@No_Name59
@No_Name59 2 жыл бұрын
Discord disappointed. There are a bunch of characters of different sorts. There are not only characters sitting in the discord itself, there are also the persons serving the discord itself (that is, this is the technical support of the discord itself and everyone connected with it). This discord is praised from all sides. This is partly true, but there is a downside to this discord. Which few people talk about. Being in this discord can be fraught for some. Better think twice. Is it worth going to this discord? And what do you need from this discord? Pros: 1) can get caught in places, but not always a normal team for communication on different topics; 2) passing raids in games that cannot be passed without communication, even if you try; 3) designed for cooperative games; Minuses: 1) in the discord there is no "confidentiality" from the word at all .; 2) different types of characters can be caught in the discord (criminals, hackers, rich characters, humorists and characters who don't care about everything and the technical support of the discord itself), as well as young people who are not quite adequate .; 3) the attendants of the discord itself who follow the discord itself do not follow their own rules from the word at all. (Technical support and everyone who is associated with the discord). 4) in discord, only "selected" characters can scold someone, swear at someone, and so on. Otherwise, they will mix the whole discord with shit in the literal sense of the word. 5) communication with a friend on the discord is disclosed by the hackers themselves and the discord service personnel. The secrecy of correspondence is not respected at all. 6) if you start swearing with someone, then his defenders who have nothing to do with swearing will crawl out, and the persecution will start from their side, and after that absolutely the entire discord is connected. 7) hackers and "knocked down on their heads" (they can and will pretend to be) comedians begin to look for people via the Internet to annoy them at home. Seeing a discord blows their heads completely. 8) in discord, not only children, but also adults (pretending to be fools) take part in this. SO FOLLOW WHAT YOU SAY AND TO WHOM YOU SPEAK. PS: at the moment, there is no need to be present in the discord. There is a certain society that has its own laws and rules at the moment. They will mix anyone with shit. either you (the group united) with shit will mix or do not knowing who at its discretion). P.S: this is a kind of group that found its own cozy little world in discord and choose new ones and evaluate them, then they draw conclusions, and then the consequences. "Cozy little world"
@killaship
@killaship 3 жыл бұрын
Another one lol I'm kinda binging this. These help so much thanks for making them!
@canglong1663
@canglong1663 2 жыл бұрын
I'm Taiwanese, I was very impressed and learned a lot after watching your video. I have subscribed to your channel, I hope you can make more games like this one, such as Snake, I'm very grateful!!!!!!!!!
@Seb2Blessed
@Seb2Blessed 3 жыл бұрын
robotic nation upload? today is a good day
@Seb2Blessed
@Seb2Blessed 3 жыл бұрын
who liked my comment, weirdo.
@tommi4685
@tommi4685 3 жыл бұрын
Very useful video, keep doing these tutorials
@TaxEvasionProfessional
@TaxEvasionProfessional 2 жыл бұрын
So underrated better than every other adult at discord bot tuts lol!
@ko_specter4251
@ko_specter4251 2 жыл бұрын
I'm pretty sure the person making this video is an adult lol
@whipyyy
@whipyyy 3 жыл бұрын
I watched all python videos and you've earned my sub!
@dirtysocks4735
@dirtysocks4735 3 жыл бұрын
right!!!! I love their channel! very helpful stuff indeed!
@Seb2Blessed
@Seb2Blessed 3 жыл бұрын
fr bro
@whipyyy
@whipyyy 3 жыл бұрын
@@Seb2Blessed yep, fr
@cybervaizean478
@cybervaizean478 3 жыл бұрын
bro i love the way you posted your program to github thx a lottttttttttttttttttttttttttttttttt
@alqkaria3996
@alqkaria3996 3 жыл бұрын
Hey, I really like your videos. The only tutorial series that has been coded with @t 1.5 and this simple/understandable I just wanna say, Could you do an improved version of the music bot? like searching by title, looping the current song,adding queue etc. I would really like that.
@Vic08654
@Vic08654 3 жыл бұрын
Really good tutorial!
@BUSTed_YoU_
@BUSTed_YoU_ 2 жыл бұрын
thanks alot,you really dont know how much it halped me!!
@dcdfm18bf18
@dcdfm18bf18 2 жыл бұрын
perfect! just what I needed
@Saaiif
@Saaiif 3 жыл бұрын
Thanks! I wanted to add more fun commands to my bot and this was perfect!
@bimbus4949
@bimbus4949 2 жыл бұрын
any other ideas what kind of commands you could do? looking for an idea too
@Saaiif
@Saaiif 2 жыл бұрын
Hmm not sure, do you mean like other games? I’ve done like Rock Paper Scissors which is pretty simple, other than that commands that give a random topic to talk about or a would you rather command that shows two option and you select which one you would rather do, there’s videos on yt for these I’m pretty sure, wish you luck :)
@bimbus4949
@bimbus4949 2 жыл бұрын
@@Saaiif ty
@XtroBag
@XtroBag 3 жыл бұрын
IT WORKS AMAZING THANK U!!
@jakob9813
@jakob9813 3 жыл бұрын
Great video, thanks :D
@roboticnationfanroboticnat1232
@roboticnationfanroboticnat1232 3 жыл бұрын
very cool video ily robotic nation
@KryllyxOfficial
@KryllyxOfficial 2 жыл бұрын
Thanks for the help.
@DeathItself
@DeathItself 3 жыл бұрын
some help pls. my code says a syntax error on line 97 that local variable 'gameOver' defined in enclosing scope on line 10 referenced before assignment.
@stopmotionworld7306
@stopmotionworld7306 3 жыл бұрын
You Are The Best!
@EitanZigmon
@EitanZigmon 3 жыл бұрын
Please for the next episode, part 2 for the MusicBot command: queue and skip commands, thank you :D.
@Bayu-wp2ku
@Bayu-wp2ku 2 жыл бұрын
tysm it's work,i use nextcord it's still work
@MauriceAlBetar
@MauriceAlBetar 3 жыл бұрын
you can edit the old message and Delete the User input for a more clean Look
@xItsJuli6666
@xItsJuli6666 3 ай бұрын
did this and my Visual Studio predicted almost everything lmao, and it was exactly like this. EVEN THE # print the board note!
@abiraroy4027
@abiraroy4027 3 жыл бұрын
hey for me it shows that checkwinner is not defined even though it definitely is how to fix anyone?
@rgamer7399
@rgamer7399 3 жыл бұрын
is there a way to not send the different lines of the board one by one, coz spam in a server may break the board
@rudra4850
@rudra4850 2 жыл бұрын
i wanna ask a thing tha can you please provide codes to add end command for this code as one of my friend started a match with bot and it was not ending
@bharatupadhyay4685
@bharatupadhyay4685 3 жыл бұрын
Hey bro , when i use place command it is not working
@ardonithoxhaj1583
@ardonithoxhaj1583 3 жыл бұрын
same for me
@lntellectual.
@lntellectual. 3 жыл бұрын
Hello, can you make a bot that can open a file with a certain path?
@l3al3ackrad85
@l3al3ackrad85 3 жыл бұрын
hi there first let me thanks for great tutorial i have a question is ir possiable to make 4*4 tabels pelase ? i realy need it that would be kind of you if u help
@vikranth3924
@vikranth3924 3 жыл бұрын
hey bro great video but there is a problem that whenever there is a tie and when we type tictactoe again it shows game in progress. PLS HELP !!!
@jacob-jm2xp
@jacob-jm2xp 3 жыл бұрын
It would be helpful if you could do another video explaining how to setup song queues with the music bot.
@l3al3ackrad85
@l3al3ackrad85 3 жыл бұрын
me too some one help please
@ardonithoxhaj1583
@ardonithoxhaj1583 3 жыл бұрын
Do more discord command videos :)
@rudransh_tyagi.
@rudransh_tyagi. 3 жыл бұрын
how to end game if other person left server between game?
@lyricsuploadtv2979
@lyricsuploadtv2979 3 жыл бұрын
Please.can you write a command to me?! I need a end command for this bevakar of someone is inactive or just not want to play you can just end the game.
@stetek-minecraft5341
@stetek-minecraft5341 3 жыл бұрын
Does anyone have a system to accept or reject?
@tervicke487
@tervicke487 3 жыл бұрын
this cant be played in multiple servers right?
@hossamal-dinhassan9652
@hossamal-dinhassan9652 3 жыл бұрын
Thanks
@sujatharentala706
@sujatharentala706 3 жыл бұрын
Bro how to use end game command?
@rensjuh
@rensjuh 3 жыл бұрын
How can i make the bot end a game automatically end the game after someone didnt respond for 30 seconds?
@talkany_ath481
@talkany_ath481 3 жыл бұрын
ayncio
@FoxGaal
@FoxGaal 8 ай бұрын
why not use interactions?
@teutonicknight4356
@teutonicknight4356 2 жыл бұрын
nice
@RocomRCM
@RocomRCM Жыл бұрын
The tictactoe command didn't start when i said "!tictactoe"
@aamilworld1091
@aamilworld1091 2 жыл бұрын
how will we end the game if not played @Robotic Nation
@VeffectProducts
@VeffectProducts 3 жыл бұрын
can someone help when I type !tictactoe id doesn't show the turn and if someone type !place 1 show that error its isn't ur turn help ???
@ethan83
@ethan83 3 жыл бұрын
Did u figure it out?
@sircogwheel
@sircogwheel Ай бұрын
I'd recommend storing the token in a .env file for safety reasons
@SNablox
@SNablox 2 жыл бұрын
How do I make my bot online?
@LugartMovies
@LugartMovies 3 жыл бұрын
I would be glad if someone can help. How can I display the winner's nickname at the end of the game? I just want to give out a reward for this, but here the condition is only X or O
@arnav-io
@arnav-io 2 жыл бұрын
if gameOver == True: if turn == player1: await ctx.send(f'{player1} wins!') if turn == player2: await ctx.send(f'{player2} wins!') add this after checking winning conditions in place function, it doesn't ping! This is what i came up with
@k-mashup7187
@k-mashup7187 3 жыл бұрын
Hey, does anyone know if there's a way to code the bot to play with you?
@hasanpasha01
@hasanpasha01 3 жыл бұрын
Just make it choose random number from the available.. this is the most simple way.
@chowgaming1675
@chowgaming1675 2 жыл бұрын
@Robotic Nation can make a tic tac toe game that has button as well as a command to stop
@yaboijaspy2512
@yaboijaspy2512 3 жыл бұрын
I coded the discord bot but on line 97 it says local variable 'gameOver' defined in enclosing scope on line 10 referenced before assignment can someone help me with that?
@DeathItself
@DeathItself 3 жыл бұрын
yea its happened to me too, ill tell you if i figure it out
@vihaannangia6719
@vihaannangia6719 3 жыл бұрын
yes same here so when i type tictactoe with the two players the X, O dosen't pop up
@hercndxles5839
@hercndxles5839 3 жыл бұрын
my bot would only go online if i write the code on replit but when i try this on replit it says Ignoring exception in command None: discord.ext.commands.errors.CommandNotFound: Command "tictactoe" is not found um... help?
@toxicsamurai2970
@toxicsamurai2970 3 жыл бұрын
Did you do @client.command()?
@PeeT_Tea
@PeeT_Tea 2 жыл бұрын
I recently wrote your TicTacToe into my Bot. But I ran into a problem which I dont know how to fix yet. To Explain it, i have a head channel where everyone can start a game of tt against another member, then a private channel for these two gets created. so far so good. if they are the only one, the game takes place normally. but the problem start if two other player starts a game simultaneously. The bot then cant run two games of ttt. Is it possible ( and if yes, how?) to implement threads to this ttt code, to have mutiple games of ttt simultaneously?
@FoxGaal
@FoxGaal 8 ай бұрын
I would recommend a version with button interactions instead :)
@caloocanboy6781
@caloocanboy6781 3 жыл бұрын
um may i request a video about "How to control your server in minecraft using CMD as a console"
@Dexter_Kemen
@Dexter_Kemen 3 жыл бұрын
says gameover not defined
@succeed949
@succeed949 2 жыл бұрын
Hey, how can i make a !stop command to end the game?
@noobpook5617
@noobpook5617 2 жыл бұрын
@client.command() async def clear(ctx): global player1 global player2 global gameOver if ctx.author == player1 or ctx.author == player2: gameOver = True await ctx.send("Game Over!") else: await ctx.send("You can only end the game played by you!")
@ibrahimbakhtiyar3201
@ibrahimbakhtiyar3201 3 жыл бұрын
Make a tutorial for auto moderation and warning system and temp warn using database
@MeronEntertainment
@MeronEntertainment 3 жыл бұрын
I don't have tutorial, but i've made something like that, available here: github.com/AzethMeron/DiscordBot-JG-ZEKE User interface isn't finished, there're probably some bugs and I need better text corpus for automated hate speech detection, BUT it does work.
@darkenfrost1
@darkenfrost1 2 жыл бұрын
Error = Traceback (most recent call last): File "c:\Users\HP\Downloads\Minigame Bot\main.py", line 23, in winningConditions = { TypeError: unhashable type: 'list'
@lon9core
@lon9core 2 жыл бұрын
Hey how would I put in an "end game" condition? Eg. !end resets board and declares such in an embed
@ValiOfficial10
@ValiOfficial10 2 жыл бұрын
I need it too
@lon9core
@lon9core 2 жыл бұрын
@@ValiOfficial10 it's been answered
@ValiOfficial10
@ValiOfficial10 2 жыл бұрын
@@lon9core yes, sorry, i have it Now
@lon9core
@lon9core 2 жыл бұрын
@@ValiOfficial10 nice one :)
@donketchum9076
@donketchum9076 3 жыл бұрын
i am having some trouble. No errors appear, but it wont send the board
@donketchum9076
@donketchum9076 3 жыл бұрын
nevermind it was a problem with the bot, not command
@SaCuber
@SaCuber 3 жыл бұрын
@@donketchum9076 I am having the same problem. How did you fix it?
@urtechtips1323
@urtechtips1323 3 жыл бұрын
How to make a levling system with leaderboard and rank Pls make a video on this.
@Seb2Blessed
@Seb2Blessed 3 жыл бұрын
ong bro
@junyang578
@junyang578 3 жыл бұрын
@@Seb2Blessed ong bro :flushed:
@drdimension4943
@drdimension4943 3 жыл бұрын
It works for the most part. When I use the command, it doesn't pick anybody, so when somebody uses the !place command, it always says that it's not their turn. Can I contact you on discord?
@filipsimovic6840
@filipsimovic6840 3 жыл бұрын
i have same prblem
@ethan83
@ethan83 3 жыл бұрын
I have the same problem too. Did u figure it out?
@nightmanmain4858
@nightmanmain4858 2 жыл бұрын
Now with your thing I got 427 lines of code and because I am running it on replit it can bairly run now XD(Also one thing about replit, in serten time the replit's RAM will be sooo high I almost can't run my bot.)
@Corsiqx
@Corsiqx 3 жыл бұрын
Very nice tutorial :D But do you have a stop command to stop a game?
@DeathItself
@DeathItself 3 жыл бұрын
@bot.command() async def end(ctx): global gameOver if not gameOver: gameOver = True await ctx.send("Stopping current game...") else: await ctx.send("There is currently no game running!")
@strangescott90
@strangescott90 3 жыл бұрын
Hi, I have a question. I want to make an event that when someone write certain message the bot answer with a message, can you help me with that?
@MauriceAlBetar
@MauriceAlBetar 3 жыл бұрын
async def on_message(self, message): if message.content == "the Certain message": message.channel.send("The answer") or for prefix: if message.content.startswith("prefix"): ...
@Kanashi34
@Kanashi34 3 жыл бұрын
@@MauriceAlBetar add bot.process_commands(message) a the end else the commands will not works
@MauriceAlBetar
@MauriceAlBetar 3 жыл бұрын
@@Kanashi34 Worked for me
@Kanashi34
@Kanashi34 3 жыл бұрын
@@MauriceAlBetar event works but not the commands
@Kanashi34
@Kanashi34 3 жыл бұрын
for me bcause bot dont separates messages and commands
@Blazikan78
@Blazikan78 3 жыл бұрын
can you do this in java script ?? i would really appreciate that ...
@official6686
@official6686 3 жыл бұрын
You can but I don’t know JavaScript so idk how
@Blazikan78
@Blazikan78 3 жыл бұрын
@@official6686 hmm ..
@felixhanson6682
@felixhanson6682 3 жыл бұрын
bruh it dosnt work for me
@darelife5717
@darelife5717 3 жыл бұрын
i tried to do it but, it didnt work even when i copy pasted the github code
@darelife5717
@darelife5717 3 жыл бұрын
It doesnt even show an error
@darelife5717
@darelife5717 3 жыл бұрын
please help me
@DeathItself
@DeathItself 3 жыл бұрын
@@darelife5717 look at my comments above and i have fixed code. sorry i just dont want to keep re-typing
@DeathItself
@DeathItself 3 жыл бұрын
The bot doesnt end game after its finished for me for some reason. Any ideas on how to fix?
@DeathItself
@DeathItself 3 жыл бұрын
nvm i fixed the code to make it better too
@DeathItself
@DeathItself 3 жыл бұрын
player1 = "" player2 = "" turn = "" gameOver = True board = [] winningConditions = [ [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6] ] @bot.command() async def ttt(ctx, p1: discord.Member, p2: discord.Member = None): if p2 == None: p2 = ctx.author global count global player1 global player2 global turn global gameOver if gameOver: global board await ctx.send(embed = discord.Embed(title="To see what each square's number is type !board")) board = [":white_large_square:", ":white_large_square:", ":white_large_square:", ":white_large_square:", ":white_large_square:", ":white_large_square:", ":white_large_square:", ":white_large_square:", ":white_large_square:"] turn = "" gameOver = False count = 0 player1 = p1 player2 = p2 line = "" for x in range(len(board)): if x == 2 or x == 5 or x == 8: line += " " + board[x] await ctx.send(line) line = "" else: line += " " + board[x] num = random.randint(1, 2) if num == 1: turn = player1 await ctx.send("It is 's turn.") elif num == 2: turn = player2 await ctx.send("It is 's turn.") else: await ctx.send("A game is already in progress! Finish it before starting a new one.") @bot.command() async def place(ctx, pos: int): global turn global player1 global player2 global board global count if not gameOver: mark = "" if turn == ctx.author: if turn == player1: mark = ":regional_indicator_x:" elif turn == player2: mark = ":o2:" if 0 < pos < 10 and board[pos - 1] == ":white_large_square:": board[pos - 1] = mark count += 1 line = "" for x in range(len(board)): if x == 2 or x == 5 or x == 8: line += " " + board[x] await ctx.send(line) line = "" else: line += " " + board[x] checkWinner(winningConditions, mark) if gameOver: await ctx.send(mark + " wins!") elif count >= 9: await ctx.send("It's a tie!") tie() if turn == player1: turn = player2 elif turn == player2: turn = player1 else: await ctx.send("Be sure to choose an integer between 1 and 9 (inclusive) and an unmarked tile.") else: await ctx.send("It is not your turn.") else: await ctx.send("Please start a new game using the !ttt command.") @bot.command() async def end(ctx): global gameOver if not gameOver: gameOver = True await ctx.send("Stopping current game...") else: await ctx.send("There is currently no game running!") def tie(): global gameOver gameOver = True def checkWinner(winningConditions, mark): global gameOver for condition in winningConditions: if board[condition[0]] == mark and board[condition[1]] == mark and board[condition[2]] == mark: gameOver = True @ttt.error async def ttt_error(ctx, error): print(error) if isinstance(error, commands.MissingRequiredArgument): await ctx.send("Please mention a player for this command.") elif isinstance(error, commands.BadArgument): await ctx.send("Please make sure to mention/ping player (ie. ).") @place.error async def place_error(ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send("Please enter a position you would like to mark.") elif isinstance(error, commands.BadArgument): await ctx.send("Please make sure to enter an integer.")
@DeathItself
@DeathItself 3 жыл бұрын
@bot.command() async def board(ctx): embed = discord.Embed(title="What each square's number is", description = ":one::two::three: :four::five::six: :seven::eight::nine:") await ctx.send(embed = embed)
@sauntinho
@sauntinho 3 жыл бұрын
@@DeathItself thx bro, helped a lot.
@DeathItself
@DeathItself 3 жыл бұрын
@@sauntinho no problem
@HuzAathiL
@HuzAathiL 3 жыл бұрын
quick question what is the command for ending the game
@stokbrot
@stokbrot 3 жыл бұрын
@client.command() async def end(ctx): global gameOver if not gameOver: gameOver = True await ctx.send("Stopping current game...") else: await ctx.send("There is currently no game running!") its not ther and this is waht you have to put in your code @DEATH ITSELF made it thx
@HuzAathiL
@HuzAathiL 3 жыл бұрын
@@stokbrot thank you
@HuzAathiL
@HuzAathiL 3 жыл бұрын
@@stokbrot also what line do i put it??
@BlueMech
@BlueMech 3 жыл бұрын
how do I end the game without winning/losing
@noobpook5617
@noobpook5617 2 жыл бұрын
You can do something like this: @client.command() async def clear(ctx): global player1 global player2 global gameOver if ctx.author == player1 or ctx.author == player2: gameOver = True await ctx.send("Game Over!") else: await ctx.send("You can only end the game played by you!") So if you type !clear it will end the game if you are the one who started the game.
@BlueMech
@BlueMech 2 жыл бұрын
@@noobpook5617 thank you
@LocoLonste
@LocoLonste 3 жыл бұрын
make end game command you are the best
@eliericksson.8950
@eliericksson.8950 3 жыл бұрын
@client.command() async def forfeit(ctx): global gameOver global player1 global player2 if ctx.author == player2 or player1: gameOver = True await ctx.send(f"{ctx.author.name} forfeits!") return Is what I made for an end command.
@fabbygsupport2593
@fabbygsupport2593 3 жыл бұрын
what is the command to end the game
@mamasuchi6052
@mamasuchi6052 3 жыл бұрын
@bot.command() async def endgame(ctx): global gameOver if gameOver is False: gameOver = True await ctx.send("Game ended")
@x3s089
@x3s089 3 жыл бұрын
Can you show how to add an end command please?
@DeathItself
@DeathItself 3 жыл бұрын
@bot.command() async def end(ctx): global gameOver if not gameOver: gameOver = True await ctx.send("Stopping current game...") else: await ctx.send("There is currently no game running!")
@rensjuh
@rensjuh 3 жыл бұрын
@@DeathItself Is there a way that you can end a game after someone didnt respond for 30 seconds?
@stokbrot
@stokbrot 3 жыл бұрын
@@DeathItself thx your so good you helped me allot
@beamkanpanan1085
@beamkanpanan1085 3 жыл бұрын
@22:12
@lazycrazy2757
@lazycrazy2757 3 жыл бұрын
AINT WORKING FOR ME COULD U PLS HELP
@UniqueBestChannel
@UniqueBestChannel 3 жыл бұрын
Me too
@hamzaromex5845
@hamzaromex5845 3 жыл бұрын
Wach khdmti dakchi f doublat ipassihom
@mikeyparker8207
@mikeyparker8207 2 жыл бұрын
I have been trying to converted it to a cog and get the error Extension 'cogs.game' raised an error: AttributeError: module 'discord.ext.commands' has no attribute 'place' THIS MEANS THE BOT HAS NOT STARTED CORRECTLY!
@scaredspike6290
@scaredspike6290 3 жыл бұрын
hey! there's no end command
@mamasuchi6052
@mamasuchi6052 3 жыл бұрын
@bot.command() async def endgame(ctx): global gameOver if gameOver is False: gameOver = True await ctx.send("Game ended")
@darkistfx6691
@darkistfx6691 2 жыл бұрын
@@mamasuchi6052 what line do you put that?
@roboticnationfanroboticnat1232
@roboticnationfanroboticnat1232 3 жыл бұрын
g-git bash
@Seb2Blessed
@Seb2Blessed 3 жыл бұрын
g-git bash
@bimbus4949
@bimbus4949 2 жыл бұрын
U cant tell me the first 4 letters of your token is a coincidence
@MeronEntertainment
@MeronEntertainment 3 жыл бұрын
By the way, you really shouldn't share your own discord token.
@sayantudu1579
@sayantudu1579 3 жыл бұрын
How to quit the game?
@mamasuchi6052
@mamasuchi6052 3 жыл бұрын
@bot.command() async def endgame(ctx): global gameOver if gameOver is False: gameOver = True await ctx.send("Game ended")
@skyler1905
@skyler1905 2 жыл бұрын
@@mamasuchi6052 tysm i needed this
@Batistagamer89
@Batistagamer89 3 жыл бұрын
100th Comment
@You_found_my_profile
@You_found_my_profile 3 жыл бұрын
you will need it: winningconditions = [ [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6] ]
@stokbrot
@stokbrot 3 жыл бұрын
you dont because your stuf is garbage where are space between the comma {Number}
@dubfy
@dubfy 2 жыл бұрын
terrible code
@RVZWN
@RVZWN 3 жыл бұрын
If you've noticed that the bot keeps going in a never-ending loop when it happens to be a tie in the x/o game then u'll just have to add this in the tie-condition if : if count >= 9: ctx.send("It's a tie") gameover = True
@RVZWN
@RVZWN 3 жыл бұрын
mine just didn't work with that elif, hope I helped, don't hate pls :3 I'm a beginner
@SNablox
@SNablox 2 жыл бұрын
@@RVZWN hello thx for the help but I dont understand where to put it if you could help ty
Actually, Maybe There's Only 1 Game of Tic-Tac-Toe
11:58
Marc Evanstein / music․py
Рет қаралды 1 МЛН
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 34 МЛН
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 15 МЛН
I tried Discord Bot Makers...
14:19
FaceDev
Рет қаралды 109 М.
Make a Discord Bot with Python | Latest Discord Py Version
17:25
Robotic Nation
Рет қаралды 96 М.
Winning Google Kickstart Round A 2020 + Facecam
17:10
William Lin
Рет қаралды 9 МЛН
Can I Run Youtube Entirely From My Terminal? (No Browser)
15:31
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 184 М.
Code a Discord Bot with Python - Host for Free in the Cloud
1:08:28
freeCodeCamp.org
Рет қаралды 2,3 МЛН
C++ Developer Learns Python
9:26
PolyMars
Рет қаралды 2,7 МЛН
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 5 МЛН
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2,3 МЛН
Копия iPhone с WildBerries
1:00
Wylsacom
Рет қаралды 8 МЛН
Запрещенный Гаджет для Авто с aliexpress 2
0:50
Тимур Сидельников
Рет қаралды 863 М.