Ask coding questions

← Back to all posts
Public IP discord bot - Runs for a minute then stops? Also prints wrong IP address
WangMauler

Hey all. Very new to all this, I put this together from a few tutorials and basic reasoning.
(https://github.com/zardini123/public-ip-discord-bot)

It basically should print my puiblic IP address in a private channel with a few of my friends, as I run a few small servers for minecraft/valheim/astroneer - I don't have a static IP address, so I'd like to be able to have them see my IP when I'm not available to give it to them when it changes (oddly enough, my ISP changes my IP a few times a week on average).

Anyway, this runs for about 60 seconds (set interval to 30 seconds) and then it just stops running, does not display anything in the console. Also, it prints out one of googles IP addresses, not my public IP.

Thanks for any help everyone.

Voters
WangMauler
Comments
hotnewtop
VulcanWM

I don’t think the bot is able to get your ip

WangMauler

@VulcanWM
I see. I may have to re-write it to use an external website to post the ip then? Like:

ip = get('https://api.ipify.org').text
print('My public IP address is: {}'.format(ip))

or something similar...

VulcanWM

i mean the only times ive successfully done it is when ive gone onto a website and the website tells me the ip address, i dont think it's possible the way you're trying to do it @WangMauler

WangMauler

@VulcanWM
I think I'll have better luck having a discord bot run a bat file, then print the results. I'm going to test that tomorrow :)

VulcanWM

good luck! @WangMauler

talkative

I dont think its discordogically possible to get ips in general

Coder100

replit proxies ip, and you are getting ips are against the TOS.

WangMauler

@Coder100

I checked the Privacy FAQ for this site, I have not seen anything mentioning getting my personal public IP address? Can you link me to said TOS violation (as the help section for this site is not very user-friendly)?

Coder100

in the tos


@WangMauler

this counts as an ip

Baconman321

@Coder100 Um, what he is doing is not a violation of rights (as far as we know).

It depends on what replit means by "violation", which is very vague.

Coder100

see
its vague
and as you may know people have been warned for doing IP logging @Baconman321

Baconman321

@Coder100 Well, that's replit's fault tbh.

However, they do reserve rights to revoke service, so sucks to be them (or the people who IP log) xD

Honestly IDK why I would log IPs, it would be better to use replit auth or cookies as of now, especially since IPs can be spoofed.

Coder100

lol

ikr
not to mention
ips have almost no use other than tracking @Baconman321

Baconman321

@Coder100 True, true...

I mean, it can help with traffic moderation and DDoS protection, but those are easily failing due to, again, IP spoofing.

WangMauler

@Coder100

The TOS you linked clearly states "of others."

Myself, is not someone else.