This commit is contained in:
Martin Dvořák 2026-08-09 01:48:25 +02:00
commit f481607761

32
main.py Normal file
View file

@ -0,0 +1,32 @@
import discord, asyncio, time
from discord.ext import commands, tasks
bot = commands.Bot(command_prefix='', case_insensitive=True, self_bot=False)
token = "put the token in here"
dmlist,whitelist = [],[]
@tasks.loop(hours=2.3)
async def send_periodic_message():
channel = bot.get_channel(910667265760956478)
if channel:
async with channel.typing():
await asyncio.sleep(5)
await channel.send("Java or Bedrock: Java 26.1.2+\nRealm, Server or World: World\nNumber of players: 5-10\nLength of play session: 2 hours\nGametype: Survival, Vanilla\nLanguage: English")
@send_periodic_message.before_loop
async def before_send_periodic_message():
await bot.wait_until_ready()
async def send_with_typing_delay(channel, content):
async with channel.typing():
await asyncio.sleep(5)
await channel.send(content)
@bot.event
async def on_message(message):
if not message.guild:
if message.author != bot.user and message.author not in dmlist:
dmlist.append(message.author)
async with message.channel.typing():
await asyncio.sleep(5)
await message.reply("the server is https://discord.gg/vyvhk7d8bX and you can find the ip in <#1528016684827414559> , also you need to get whitelisted so put your username in <#1535334637667221514> , if you have any questions check <#1535740802993758279> , sorry if u dm'ed me because of something else than the server I just copy paste this response to everyone who dm's me for now..")
@bot.event
async def on_ready():
if not send_periodic_message.is_running():
send_periodic_message.start()
bot.run(token)