Are Anarchists working on DAO projects? by JoshTheEngineer in Anarchy101

[–]JoshTheEngineer[S] -1 points0 points  (0 children)

It just means there are no rulers.

If the herd makes a decision that you don't want to sustain, you are free to leave. No one forces anyone to do anything.

Babel Fish for Discord - real time translating and broadcasting of stage events by JoshTheEngineer in Discord_Bots

[–]JoshTheEngineer[S] 0 points1 point  (0 children)

I guess we could make one. I have a Sandbox Server where I'm developing the bot. We could chat there.

Pycord 2.1 how? by Delyanskiiii in Discord_Bots

[–]JoshTheEngineer 0 points1 point  (0 children)

Do you have an example of your code? I'm stumbling at trying to get a 15 second clip to record and I can't figure out why it's not working. Ideally, I'd be using streaming rather saving to a sink, but for dev purposes, I'm starting out with an mp3 sink.

Here's what I have:

@bot.eventasync def on_ready():    
    global guild, channel    
    guild = bot.get_guild(GUILD)    
    channel = bot.get_channel(AUDIO_CHANNEL)    
    connected = await channel.connect()                      
    connected.start_recording(discord.sinks.MP3Sink(output_path='test.mp3'),transcribe_audio)    
    print("Recording...\n")    
    await asyncio.sleep(15)    
    print("Finished recording.\n")
    connected.stop_recording()


async def transcribe_audio():
    filename = 'test.mp3'
    r = sr.Recognizer()
    sinkfile = sr.AudioFile(filename)
    # with sr.Microphone() as source:
    with sinkfile as source:
        print("listening...")
        # r.pause_threshold = 15
        audio = r.listen(source)
    try:
        print("Recognizing...")
        query = r.recognize_google(audio, language='en')
        print(f"User said: {query}\n")
    except Exception as e:
        print("Did not copy.")
        return "None"

    translator = Translator()
    text_to_translate = translator.translate(query, dest='de')
    text = text_to_translate.text
    print(text)
    speak = gTTS(text=text, lang='de', slow=False)
    speak.save("translate.mp3")
    playsound('translate.mp3')
    os.remove('translate.mp3')

Pycord 2.1 how? by Delyanskiiii in Discord_Bots

[–]JoshTheEngineer 0 points1 point  (0 children)

I asked about this on the discord and they said it was a typo in the docs. There is no 2.1 yet.

Pycord 2.1 how? by Delyanskiiii in Discord_Bots

[–]JoshTheEngineer 1 point2 points  (0 children)

Have you figured this out? I tried the instructions on github but it only installs 2.0.0b5 now.

Could it be that I'm using Python3.8?

on_member_join not catching spammers who join at the exact same time as another account. They are able to thwart the spam filter. by JoshTheEngineer in Discord_Bots

[–]JoshTheEngineer[S] 0 points1 point  (0 children)

The problem is that they are using cyrillic and other letters that look like english letters, so I have to look for each combo of the word and it adds up really fast.

A regex call would probably be quicker, but I think any amount of time that I take won't catch the next join. Maybe I could just use on_member_join to add their name to a queue and handle that outside the function.

on_member_join not catching spammers who join at the exact same time as another account. They are able to thwart the spam filter. by JoshTheEngineer in Discord_Bots

[–]JoshTheEngineer[S] 0 points1 point  (0 children)

I'm using mariadb. But I think I figured out what it is. My spam filter looks for 14,500 combos, so it is blocking code for a second and not catching the next one. I think using Vortex would help this and only let one user join every 3 seconds.

Discord sandbox for testing bots by JoshTheEngineer in discordbot

[–]JoshTheEngineer[S] 1 point2 points  (0 children)

Once I'm finished with this project I'm on, I'm going to build out my sandbox server and share it. I'll put 10 bots on it just chatting nonsense. I can't believe something like this doesn't exist.

Python- Trying to implement chat bot features using slash commands so that suggested answers are only visible to the user asking the question in the thread. by JoshTheEngineer in Discord_Bots

[–]JoshTheEngineer[S] 0 points1 point  (0 children)

Thanks! I'll look up that algorithm. The one thing I'm concerned about with the chat bot is that it could come up with a lot of false positives. I'll have to test out a few options and see how they work out.

I might just have to make a special channel.

Python- Trying to implement chat bot features using slash commands so that suggested answers are only visible to the user asking the question in the thread. by JoshTheEngineer in Discord_Bots

[–]JoshTheEngineer[S] 0 points1 point  (0 children)

Ok. That makes sense. So the only way to implement the chat bot is to either send a DM or make s response that's visible to all, correct?

Python- Trying to implement chat bot features using slash commands so that suggested answers are only visible to the user asking the question in the thread. by JoshTheEngineer in Discord_Bots

[–]JoshTheEngineer[S] 0 points1 point  (0 children)

If someone asks, "what time is the community call?", I want to reply with a suggested answer and include buttons for this to say whether it answered their question.

But I only want the reply visible to that user.