You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
members = guild.members
voice_channels = [channel for channel in guild.channels if isinstance(channel, discord.VoiceChannel)]
online_members = len([member for member in members if member.status != discord.Status.offline])
voice_members = sum(len(channel.members) for channel in voice_channels)
channel_count = len(guild.channels)
banner_url = "#url" # url banner
banner_response = requests.get(banner_url, stream=True)
banner_image = Image.open(banner_response.raw).convert('RGB')
draw = ImageDraw.Draw(banner_image)
font = ImageFont.truetype('Marvin.ttf', size=48) # font size+ point coordinates
draw.text((#point), f' {len(members)}', font=font, fill='white')
draw.text((#point), f'{voice_members}', font=font, fill='white')
banner_image.save('banner.png')
with open('banner.png', 'rb') as banner_file:
await guild.edit(banner=banner_file.read())
#for set banner, u need have in folder ready image banner and set url image banner. U need have in folder font for banner
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
import discord
import requests
import asyncio
from PIL import Image, ImageDraw, ImageFont
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print('Logged in as {0.user}'.format(client))
while True:
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="#what listening?"))
await update_banner()
await asyncio.sleep(80)
async def update_banner():
guild = client.get_guild(#guild id)
#for set banner, u need have in folder ready image banner and set url image banner. U need have in folder font for banner
#module require:
#pip install pillow
#pip install discord
#pip install request
#pip install asyncio
#by 2101017#0508
Beta Was this translation helpful? Give feedback.
All reactions