Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to make a bot send whatever you dm it into a server discord.py

# We will be importing the discord.ext.commands extension for this.
from discord.ext import commands
import discord

# We make the bot definition and set the prefix to !
bot = commands.Bot(command_prefix='!')

# Here starts the real fun
@bot.command()
async def DM(ctx, user: discord.User, *, message=None):
	# Once we define the argunments we need, it's pretty straight forward.
    message = message
    await user.send(message)
	# You, that's it!

bot.run("TOKEN")
Comment

PREVIOUS NEXT
Code Example
Python :: gdscript fixed decimal 
Python :: pandas combine year month day column to date 
Python :: join on index python 
Python :: what is mustafa nickname 
Python :: how to do tail recursion in python 
Python :: pandas to_csv hebrew 
Python :: dependency inversion 
Python :: Python __add__ magic method 
Python :: python switch 
Python :: How can i restrict letters after a number in an input in Python 
Python :: python manually trigger exception 
Python :: Python NumPy ndarray.T Example to convert an array 
Python :: how to add path to python in windows 
Python :: even in python 
Python :: keras functional api embedding layer 
Python :: add text to jpg python 
Python :: default dictionary value 
Python :: Getting the first element from each list in a column of lists 
Python :: Sqlalchemy Define class from existing table 
Python :: dbscan example 
Python :: python string [::-1] 
Python :: seaborn heatmap center xticks 
Python :: python function 
Python :: get output of a function in a variable python 
Python :: django models filter 
Python :: jupyter dataframe print all 
Python :: how to know the column number of a dataframe in pandas 
Python :: aiohttp specify app IP 
Python :: ide for python 
Python :: python download chromebook 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =