Home > Software design >  Send Message to all Friends Discord.py (User Token)
Send Message to all Friends Discord.py (User Token)

Time:11-02

How would I go about sending a Message to all my friends? I'm hoping to be able to achieve this with the Discord.py library, hopefully someone here knows. Please note that i want to access my friend list using my token, this is not a bot. I do this because i want to automate my dms to answer some everyday questions.

I currently get this Error:

TypeError: 'module' object is not callable

Program:

import discord

with open('TOKEN_TESTUSER.txt', 'r') as f:
    TOKEN = f.readline()

client = discord.client()

@client.event
async def on_connect():
    for user in client.user.friends:
        try:
            await user.send('Message')
            print("Working")
            
        except:
            print("Not working")

client.run(TOKEN, bot=False)

I really appreciate any answer.

CodePudding user response:

Discord removed this feature when migrating to version 2.0.
You can see a list of the changes here.

Unfortunately, I think you can no longer message your friends on discord with a bot. :(

  • Related