class Location:
def __init__(self, name, description):
self.name = name
self.description = description
def __str__(self):
return f"{self.name}: {self.description}"
class Character:
def __init__(self, name, hp, rank):
self.name = name
self.hp = hp
self.rank = rank
def __str__(self):
return f"{self.rank} {self.name} (HP: {self.hp})"
class Game:
def __init__(self):
self.locations = [Location("Chaes", "Территория монолитов"),
Location("Kordon", "Передовая сталкеров")]
self.characters = []
def start(self):
print("Welcome to колхозный S.T.A.L.K.E.R ёпт")
print("Доступные локации:")
for location in self.locations:
print(location)
print("")
location_name = input("Введите локацию (например, Kordon): ")
location = None
for l in self.locations:
if l.name == location_name:
location = l
break
if location is None:
print("Неизвестная локация!")
return
print("==============================================================")
if location.name == "Chaes":
for i in range(20):
monolit = Character("Monolit", 120, "Master")
self.characters.append(monolit)
print("Уууууу ты нарвался на монолитов:")
for c in self.characters:
print(c)
elif location.name == "Kordon":
for i in range(10):
stalker = Character("Stalker", 100, "Noob")
self.characters.append(stalker)
for i in range(5):
mutant = Character("Psevdosobaki", 90, "None")
self.characters.append(mutant)
print("Не мельтеши особо и трогать тебя не будут:")
for c in self.characters:
print(c)
print("==============================================================")
input("Нажмите Enter, чтобы выйти")
if __name__ == "__main__":
game = Game()
game.start()
elif operation == "discriminant":
a = int(input("Enter the value of a: "))
b = int(input("Enter the value of b: "))
c = int(input("Enter the value of c: "))
discriminant = (b**2) - (4*a*c)
print(f"The discriminant of the quadratic equation is {discriminant}")
else:
print("Неизвестная операция!")
calculate()
import config
from aiogram import Bot, Dispatcher, types, executor
bot = Bot(token=config.Token)
dp = Dispatcher(bot)
# Helper function to send a photo with caption and reply markup
async def send_photo_with_markup(chat_id: int, photo: str, caption: str, markup):
await bot.send_photo(chat_id=chat_id, photo=InputFile(photo), caption=caption, reply_markup=markup)
@dp.message_handler(commands=['start'])
async def start(message: types.Message):
await send_photo_with_markup(message.chat.id, "media/main.jpg", bottext.maintext, nav.mainMenu)
@dp.callback_query_handler(text='faq')
async def faq(callback: types.CallbackQuery):
await send_photo_with_markup(callback.message.chat.id, "media/faq.jpg", bottext.faqtext, nav.faqMenu)
@dp.callback_query_handler(text='start')
async def callstart(callback: types.CallbackQuery):
await send_photo_with_markup(callback.message.chat.id, "media/main.jpg", bottext.maintext, nav.mainMenu)
await callback.answer()
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=False)
@client.slash_command(description="Посмотрите аватар сервера")
async def guild_avatar(interaction, server: Union[disnake.Guild, int]=None):
"""
Retrieves the avatar of a guild.
"""
if server is None:
server = interaction.guild
elif isinstance(server, int):
# Retrieve the server object using the provided id
server = await client.fetch_guild(server)
embed = disnake.Embed(description = f"Аватар сервера - {server.name}", colour = disnake.Color.blue())
embed.set_image(url = server.icon.url)
await interaction.send(embed = embed)