A discord bot generated using ChatGPT. These are just tests so I dont recommend you use these in prod.
Last active
December 6, 2022 02:54
-
-
Save redtrillix/3df6bdfcd0b1094abf6a2eb09593857c to your computer and use it in GitHub Desktop.
A discord bot generated using ChatGPT (https://chat.openai.com/chat)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Discord = require('discord.js'); | |
const client = new Discord.Client(); | |
client.on('ready', () => { | |
console.log(`Logged in as ${client.user.tag}!`); | |
}); | |
client.on('message', msg => { | |
if (msg.content === 'ping') { | |
msg.reply('pong'); | |
} | |
}); | |
client.login('your_bot_token_here'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
client = commands.Bot(command_prefix='!') | |
@client.event | |
async def on_ready(): | |
print('Bot is ready.') | |
@client.command() | |
async def play(ctx, url): | |
channel = ctx.message.author.voice.channel | |
voice = await channel.connect() | |
voice.play(discord.FFmpegPCMAudio(url)) | |
client.run('your_bot_token_here') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment