import discord
import os
from discord.ext import commands
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "arona bot start"
def run():
app.run(host="0.0.0.0", port=8000)
def keep_alive():
server = Thread(target=run)
server.start()
intents = discord.Intents.default()
intents.typing = False
intents.presences = False
intents = discord.Intents(messages=True, guilds=True)
client = commands.Bot(command_prefix='-', intents=intents)
client = commands.Bot(command_prefix='/', intents=intents)
keep_alive()
@client.event
async def on_ready():
print("arona Bot พร้อมแล้วคะ")
@client.event
async def on_message(message):
await client.process_commands(message)
if message.author == client.user:
return
if message.content.startswith('-arona'):
b = ('aronaเอง ><')
print('arona')
elif message.content.startswith('-หวัดดี'):
b = ('สวัดดีคา')
elif message.content.startswith('-ไง'):
b = ('สวัดดีคา')
elif message.content.startswith('-สวัสดี'):
b = ('สวัดดีคา')
elif message.content.startswith('-หวัดดีarona'):
b = ('สวัดดีคา')
elif message.content.startswith('-ไงarona'):
b = ('สวัดดีคา')
elif message.content.startswith('-สวัสดีarona'):
b = ('สวัดดีคา')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
await message.channel.send(b)
token = os.getenv('TOKEN')
client.run(token)
https://discord.com/api/oauth2/authorize?client_id=991381735612891176&permissions=256064&scope=bot
มีใครรู้บ้างว่าทำไมบอทผมมันไม่ยอมทำงานในกลุ่มดิสแต่กลับทำงานในแชทส่วนตัว
import os
from discord.ext import commands
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "arona bot start"
def run():
app.run(host="0.0.0.0", port=8000)
def keep_alive():
server = Thread(target=run)
server.start()
intents = discord.Intents.default()
intents.typing = False
intents.presences = False
intents = discord.Intents(messages=True, guilds=True)
client = commands.Bot(command_prefix='-', intents=intents)
client = commands.Bot(command_prefix='/', intents=intents)
keep_alive()
@client.event
async def on_ready():
print("arona Bot พร้อมแล้วคะ")
@client.event
async def on_message(message):
await client.process_commands(message)
if message.author == client.user:
return
if message.content.startswith('-arona'):
b = ('aronaเอง ><')
print('arona')
elif message.content.startswith('-หวัดดี'):
b = ('สวัดดีคา')
elif message.content.startswith('-ไง'):
b = ('สวัดดีคา')
elif message.content.startswith('-สวัสดี'):
b = ('สวัดดีคา')
elif message.content.startswith('-หวัดดีarona'):
b = ('สวัดดีคา')
elif message.content.startswith('-ไงarona'):
b = ('สวัดดีคา')
elif message.content.startswith('-สวัสดีarona'):
b = ('สวัดดีคา')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('-'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
elif message.content.startswith('/'):
b = ('')
await message.channel.send(b)
token = os.getenv('TOKEN')
client.run(token)
https://discord.com/api/oauth2/authorize?client_id=991381735612891176&permissions=256064&scope=bot