-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
221 lines (205 loc) · 10.6 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# Import stuff heh
## discord.py
import discord
## keep_alive.py
import keep_alive
## some other stuff
from mcstatus import MinecraftServer
from decouple import config
from MaxEmbeds import EmbedBuilder
# keep_alive to receive ping.
keep_alive.keep_alive()
# Start server, with commands and stuff.
server = MinecraftServer.lookup(config('ADDRESS'))
skyblock = MinecraftServer.lookup(config('SKYBLOCKADDRESS'))
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
print('Made with <3 by QuanTrieuPCYT')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('.t status'):
try:
status = server.status()
embed = EmbedBuilder(
title="Oh hey, Thicc SMP is online :D",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["IP (Java + Bedrock)", "thiccsmp.qtpc.tech", True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Unfortunately, Thicc SMP went offline :(",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
if message.content.startswith('.t stasus'):
try:
status = server.status()
embed = EmbedBuilder(
title="Sussy baka, Thicc SMP is online :D",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["IP (Java + Bedrock)", "thiccsmp.qtpc.tech", True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Man, so sus, and Thicc SMP went offline :(",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
#await message.channel.send('Oops so sus, **Thicc SMP** **is currently offline**!')
if message.content.startswith('.t statú'):
try:
status = server.status()
embed = EmbedBuilder(
title="Telex user huh? Nevermind, Thicc SMP is online :D",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["IP (Java + Bedrock)", "thiccsmp.qtpc.tech", True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Telex user huh? Welp, Thicc SMP is offline :(",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
if message.content.startswith('.t stasú'):
try:
status = server.status()
embed = EmbedBuilder(
title="Sussy baka, Thicc SMP is online :D",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["IP (Java + Bedrock)", "thiccsmp.qtpc.tech", True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Man, so sus, and Thicc SMP is offline :(",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
#await message.channel.send('Unikey user huh? Nevermind, wait... **Thicc SMP** **is currently offline**!')
## remave ping cuz if i hosted it on the same machine. ping = 0.xx ms => useless
if message.content.startswith('.t players'):
try:
player = server.status()
playerskyblock = skyblock.status()
embed = EmbedBuilder(
title="Thicc SMP Playercount",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["SMP", "{0}/69".format(player.players.online), True], ["SkyBlock", "{0}/50".format(playerskyblock.players.online), True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Thicc SMP is offline :(",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
#await message.channel.send('Oops, **Thicc SMP** is currently **offline**!')
if message.content.startswith('.t playẻ'):
try:
player = server.status()
playerskyblock = skyblock.status()
embed = EmbedBuilder(
title="Telex user? Anyways here is the Thicc SMP Playercount",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["SMP", "{0}/69".format(player.players.online), True], ["SkyBlock", "{0}/50".format(playerskyblock.players.online), True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Telex user? Nevermind, Thicc SMP is offline :(",
description="Powered by AlynaaStatus",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
#await message.channel.send('Oops, **Thicc SMP** is currently **offline**!')
## remave ping cuz if i hosted it on the same machine. ping = 0.xx ms => useless (from typical)
# ping is still here as i also want to get the ping from my webserver when the mainserver is off (in the near future)
if message.content.startswith('.t ping'):
try:
latency = server.ping()
latencyskyblock = skyblock.status()
embed = EmbedBuilder(
title="Thicc SMP Latency from Replit",
description="Powered by AlynaaStatus, hosted on Replit",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["SMP Latency (ms)", "{0} from Replit.".format(latency), True], ["SkyBlock Latency (ms)", "{0} from Replit.".format(latencyskyblock), True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Thicc SMP is offline and I can't check the latency :(",
description="Powered by AlynaaStatus, hosted on Replit",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
#await message.channel.send('Oops, **Thicc SMP** is currently **offline**!')
if message.content.startswith('.t latency'):
try:
latency = server.ping()
latencyskyblock = skyblock.status()
embed = EmbedBuilder(
title="Thicc SMP Latency from Replit",
description="Powered by AlynaaStatus, hosted on Replit",
color=discord.Color.from_rgb(0, 255, 255),
fields=[["SMP Latency (ms)", "{0} from Replit.".format(latency), True], ["SkyBlock Latency (ms)", "{0} from Replit.".format(latencyskyblock), True]],
thumbnail='https://cdn.discordapp.com/emojis/878887184915136542.gif'
).build()
await message.channel.send(embed=embed)
except:
# no need for player status variables as it went offline already.
embed = EmbedBuilder(
title="Thicc SMP is offline and I can't check the latency :(",
description="Powered by AlynaaStatus, hosted on Replit",
color=discord.Color.from_rgb(244, 41, 65),
fields=[["Try checking us out later!", ":AlynaCri:", True]],
thumbnail='https://cdn.discordapp.com/emojis/880069948821622844.png'
).build()
await message.channel.send(embed=embed)
#await message.channel.send('Oops, **Thicc SMP** is currently **offline**!')
client.run(config('TOKEN'))