class Memory:
def write(name, value):
with open(name, "w") as file:
file.write(str(value))
def read(name):
with open(name, "r") as file:
text = file.read()
return text
if webhook.user == bot.user:
if msg.content.startswith(webhook.name):
try:
url = None
try:
url = Memory.read(f"avatars/{msg.channel.id}{webhook.name}webhook.txt")
except:
await webhook.send(content = msg.content[len(webhook.name) + 1:])
await msg.delete()
else:
await webhook.send(content = msg.content[len(webhook.name) + 1:], avatar_url=url)
await msg.delete()
except disnake.errors.HTTPException:
await msg.reply("Слишком много HTTPS запросов на данный момент, простите...")
async def join_channel(ctx): # Функция входа в канал
voice = ctx.author.voice
if not voice: return "notChannel"
if voice:
await voice.channel.connect()
return None
async def play(ctx, filename): # Функция старта воспроизведения
voice_state = ctx.guild.voice_client
if not voice_state:
error = await Song.join_channel(ctx)
if error:
return error
voice_state = ctx.guild.voice_client
voice_state.play(disnake.FFmpegPCMAudio(f"songs/{ctx.guild.id}.mp3"), None)
return None
async def _play(self, ctx, название: str): # Сама команда
await ctx.response.defer()
name = название
if name.startswith("https://"):
return await ctx.send(embed=disnake.Embed(title="❌Ошибка",description="Я не поддерживаю ссылки!",color=disnake.Color.red()))
track = Song.search_tracks(ctx, name)
if track == "notSearched": return await ctx.send(title="❌Ошибка",description="Ничего не удалось найти.",color=disnake.Color.red())
error = await Song.play(ctx, f"{ctx.guild.id}")
if error:
if error == "notChannel": return await ctx.send(embed=disnake.Embed(title="❌Ошибка",description="Зайдите в голосовой канал.",color=disnake.Color.red()))
await ctx.send(embed=disnake.Embed(title="Сейчас играет",description=f"{track['title']}",color=0x228b22))
#include <LCD_1602_RUS.h>
#include <SPI.h>
#include <MFRC522.h>
LCD_1602_RUS lcd(0x27, 16, 2);
MFRC522 rider(9, 10);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.init();
//lcd.backlight();
lcd.clear();
lcd.print("Почти всё готово...");
Serial.println("Second...");
delay(3000);
Serial.println("Ready!");
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Поднесите карту");
SPI.begin();
rider.PCD_Init();
delay(10);
Serial.println("SPI and RFID are connected!");
}
void loop() {
// put your main code here, to run repeatedly:
if (rider.PICC_IsNewCardPresent() and rider.PICC_ReadCardSerial()) {
Serial.println("Card is pressed");
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Карта распознана");
lcd.setCursor(0,1);
lcd.print(" ");
delay(5000);
} else {
Serial.println("Card is not pressed");
lcd.noBacklight();
lcd.setCursor(0,0);
lcd.print("Поднесите карту ");
lcd.setCursor(0,1);
lcd.print(" ");
}
}
video {
position: absolute;
}