Share your repls and programming experiences

← Back to all posts
Cytotron - Take your discord server to the next level
h
LeviathanCoding (1445)

Cytotron is a powerful discord bot that will make your discord server way more active and way more fun. With built-in role handouts, googling, sha-256 encrypting, and more, you are sure to enjoy the bot.

This is my first discord bot. Thanks to the help of google and stackoverflow for helping me with this.

What are you waiting for? Go to the website and add the bot to your server!
https://cytotron-bot.gq/

If you have any feedback on the bot, please message me in discord at LeviathanProgramming#2139 or contact me by email (on the website).

I will most likely stop answering comments on this repl after a while.

This is for the repl Jam on discord bots. I'm hoping to win $1000 in bitcoin!

Comments
hotnewtop
JacobMcPherson1 (239)

I don't know much about discord bots, but this is still cool!

rohithsam (3)

cool discord bot, but if ur 15 how have you already graduated from high school? @LeviathanCoding

LeviathanCoding (1445)

I was homeschooled, @rohithsam ,so I could do school really fast.

STCollier (36)

@LeviathanCoding me too, and I really enjoy it.

rohithsam (3)

@LeviathanCoding so does that mean that ur in college rn or ur going to college next year? lmao still confused tho

P0GCHAMPB0i (54)

?!??!!??!?!?!??!??!??!?!?!??!?!?!?!?!??!?!????

firefish (948)

Ah yes, my favourite top-level domain: .gq.

ElliotMassey (2)

@firefish I heard google is moving to it I see it now "google.gq"

ElliotMassey (2)

@LeviathanCoding just you wait
"repl.gq"
"discord.gq"
"youtube.gq"
the gq Apocalypse is coming

firefish (948)

@LeviathanCoding yeah there's this thing called a joke

Whippingdot (660)

Why not binging ;)

or ducking ;;)

chinnupavan48 (0)

can you tell me how to make this bot alive forever ? Thanks in advance..

LeviathanCoding (1445)

@chinnupavan48 , Hacker plan and/or website monitor.

codeninja135 (35)

what if someone makes an AD bot that collects ad revenue from you lmao

christiant (1)

You should try using Cogs instead of a single file, the bot will end up being bogged down after a while.

JakeHu2020 (21)

In orbitron-3 you said cytotron was gonna be a planet

LeviathanCoding (1445)

@JakeHu2020 , IK, but I decided to use it as a name for my bot :)

ArjunAnish (0)

@LeviathanCoding is this bot hosted on repl 24/7? If it is than could you tell me how to do that as well?

LeviathanCoding (1445)

@ArjunAnish , I have the hacker plan. That's how.

PyCoder01 (56)

bitcoin is crashing. Not worth the bitcoin. Anyways nice.

WiiU (0)

To anyone confused this is how you get it up and running.

  1. go to discord dev portal: https://discord.com/developers/applications
  2. press new application
  3. after you press on new application name it.
  4. now you should see a screen with tabs on the left, press bot.
  5. in bot tab click add bot.
  6. now you should be on the bots profile, under its username press copy token PS: DONT SHARE THE TOKEN WITH ANYONE.
  7. fork this repl.
    go to the secrets tab in the forked repl and create a new secret with the name of bot_token.
  8. now paste the token in to the value of the secret!.
  9. if you scroll down in the secrets tab you should see a way to add the secret to your code, press that.
  10. it should work now.
  11. wanna add it to your server?
    12 go to Oauth2 tab in the application page.
  12. copy the bots id.
    14 https://discordapp.com/oauth2/authorize?scope=bot&client_id=addurbotsidherelol
  13. once youve done that click on the drop down and select a server! you should be all done!

Or just press this https://discord.com/oauth2/authorize?client_id=848343750300139551&permissions=8&scope=bot :D

LeviathanCoding (1445)

@WiiU , that isn't the whole process. The user has to add the other env keys in!!

WiiU (0)

@LeviathanCoding
Whoops! Forgot all about that, Will add. Are they nesscary though?

CodingCactus (4367)

This is for the repl Jam on discord bots

that was a few years ago :/

CodingCactus (4367)

@LeviathanCoding no, the last jam was the game jam with theme "shoot" a few months ago celebrating the launch of kaboom.js

JBloves27 (1887)

I think there was another one, the link should be here @CodingCactus

ThanhTails (32)

great! But can you fix the error in the first?

LeviathanCoding (1445)

@FrancisPan , you have to input all the secret keys.

ElliotMassey (2)

@FrancisPan youve got to the discord developer page and get a bot token

[deleted]

Nice! BTW, you know the c in the center of the page? How do you make the lines make the outline of the c?

tankerguy1917 (178)

I would totally use this in my discord servers, but my school has decided that Discord, and anything else someone might enjoy, are unacceptable and need to be blocked. The website looks good though, I like the color scheme.

ElliotMassey (2)

@tankerguy1917 my school too, but i find a way ;)

tankerguy1917 (178)

@ElliotMassey lol. I could, but my loophole doesn't let me sign into any e-mail, so when discords freaks out about me logging in on a different computer I can't let discord know that its really me.

tankerguy1917 (178)

@ElliotMassey Yeah, but I can still go on reddit, so thats good I guess.

RayhanADev (2524)

Neat, but I see the biggest problem of all Python projects. Control Flow. So many if/else/if-else and try-expects. Maybe spilt it all into separated functions and wrap those in a try-except function? Also consider classes for the different operations?

Also the requests lib is synchronous, try using aiohttp and asyncio so it isn't blocking?

Lastly, do you need to change line 378? I'm not all too familiar with Discord API but that URL schema looks fixed so it won't work on forked instances...

LeviathanCoding (1445)

@RayhanADev , I stored the bot invite in the env file and also, I'll try using asyncio or aiohttp to get APIs instead.

firefish (948)

@RayhanADev i love how every other language on earth has a try catch and python is just sitting there with try-except

ModernSonicEXE (3)

Umm. what happened. I'm pretty sure nothing but I guess its cool.

LeviathanCoding (1445)

@ModernSonicEXE , view the website. Link is in the readme.

JWZ6 (670)

never mind gud job

FelixF809 (5)

doesnt work Traceback (most recent call last): File "main.py", line 647, in <module> client.run(os.getenv('bot_token')) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 723, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 702, in runner await self.start(*args, **kwargs) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 665, in start await self.login(*args, bot=bot) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 511, in login await self.http.static_login(token.strip(), bot=bot) AttributeError: 'NoneType' object has no attribute 'strip' 

LeviathanCoding (1445)

@FelixF809 , that's because I guess when you forked it, the env file is destroyed

CosmicBear (18)

@LeviathanCoding Maybe because the .env files only register for you so for us it doesn't exist

Dunce (70)

@LeviathanCoding .env files are no longer supported, you have to use the "secrets" tab now.

LeviathanCoding (1445)

@Dunce , I know. That's what I use.

firefish (948)

@LeviathanCoding .env files are no longer supported, you have to use the "secrets" tab now.

@Dunce same thing

Brendan23 (166)

@LeviathanCoding hmmm... the drawing is a little messed up:

LeviathanCoding (1445)

@Brendan23 , a little. I stuck it into an svg converter and that was the best I could get.

LeviathanCoding (1445)

@JWZ6 , It works. If you forked it, then it won't cuz the bot token is a secret.

XenoniCoder (1)

@LeviathanCoding
It's me Xenonic778 from Khan Academy.