Skip to content

Commit

Permalink
The-Bot v4.0.0 migrated to slash commands and added a command called …
Browse files Browse the repository at this point in the history
…topic
  • Loading branch information
CSP02 committed Apr 17, 2023
1 parent dbc6cae commit 823faf6
Show file tree
Hide file tree
Showing 112 changed files with 8,928 additions and 4,936 deletions.
Binary file removed Images/infr.png
Binary file not shown.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# The-Bot
![The-Bot](./resouces/THE-BOTEDITED.png "The-Bot")
![issues](https://img.shields.io/github/issues/Chandra-sekhar-pilla/The-Bot-v2.0.0)
![forks](https://img.shields.io/github/forks/Chandra-sekhar-pilla/The-Bot-v2.0.0)
![stars](https://img.shields.io/github/stars/Chandra-sekhar-pilla/The-Bot-v2.0.0)
![license](https://img.shields.io/github/license/Chandra-sekhar-pilla/The-Bot-v2.0.0)
![version](https://img.shields.io/badge/Version-2.3.3-green)
![issues](https://img.shields.io/github/issues/Chandra-sekhar-pilla/The-Bot)
![forks](https://img.shields.io/github/forks/Chandra-sekhar-pilla/The-Bot)
![stars](https://img.shields.io/github/stars/Chandra-sekhar-pilla/The-Bot)
![license](https://img.shields.io/github/license/Chandra-sekhar-pilla/The-Bot)
![version](https://img.shields.io/badge/Version-4.0.0-green)


> The default prefix is "!".
Expand Down
48 changes: 48 additions & 0 deletions SlashCommands/Custom Commands/ModuleInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module.exports = {
Module: 'Custom Commands',
Description: 'Module which contains custom commands that can be used by the user.',
Commands: [
{
Name: 'debug',
Description: 'Sends a tip to debug your code in unity.',
Syntax: '/debug',
Permission: 'Everyone',
},
{
Name: 'info',
Description: 'Sends the info about the bot.',
Syntax: '/info',
Permission: 'Everyone',
},
{
Name: 'learndjs',
Description: 'Sends few useful links to learn discord.js.',
Syntax: '/learndjs',
Permission: 'Everyone',
},
{
Name: 'learnjs',
Description: 'Sends few useful links to learn javascript.',
Syntax: '/learnjs',
Permission: 'Everyone',
},
{
Name: 'learnunity',
Description: 'Sends few useful links to learn unity.',
Syntax: '/learnunity',
Permission: 'Everyone',
},
{
Name: 'longcode',
Description: 'Sends the pastemyst link which is used to paste your code.',
Syntax: '/longcode',
Permission: 'Everyone',
},
{
Name: 'togglerjs',
Description: 'Send the cdn link of toggler.js.',
Syntax: '/togglerjs',
Permission: 'Everyone',
}
]
}
11 changes: 11 additions & 0 deletions SlashCommands/Custom Commands/debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
name: 'debug',
data: new SlashCommandBuilder()
.setName('debug')
.setDescription('A way to debug your code/game in unity.'),

async execute(client, interaction, Discord) {
await interaction.channel.send("If you have a code which isn't working and there are no errors or warnings of such kind use ``Debug.Log()``. This will help you where actually the unknown error is.\nlet's take an example like if you wrote a code of rotating something but after you start or run the code the object is not rotating use ``Debug.Log()`` command at the part where you think the code is not working.This is a nice practise even while in general coding. ~~Even I use this type of commands more~~.\n\n'When you get lost, use Debug.Log()' - BLAME <@341756841576890378> for this quote.")
}
}
40 changes: 40 additions & 0 deletions SlashCommands/Custom Commands/info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
name: 'info',
data: new SlashCommandBuilder()
.setName('info')
.setDescription('sends info about The Atelier server'),

async execute(client, interaction, Discord) {
console.log("yes")
const embedMsg = new Discord.EmbedBuilder()
.setTitle('My info:')
.setColor('#9c0af7')
.addFields([
{ name: 'Name:', value: 'The-Bot' },
{ name: 'Guild Count', value: `${client.guilds.cache.size}` }
])
const row = new Discord.ActionRowBuilder()
.addComponents([
new Discord.ButtonBuilder()
.setLabel('The-Bot')
.setStyle('Link')
.setURL('https://github.com/Chandra-sekhar-pilla/The-Bot-v1.4.0'),
new Discord.ButtonBuilder()
.setLabel('Developer website')
.setStyle('Link')
.setURL('https://the-atelier.ml'),
new Discord.ButtonBuilder()
.setLabel('Invite')
.setStyle('Link')
.setURL('https://discord.com/oauth2/authorize?client_id=852171190696017970&scope=applications.commands%20bot&permissions=8589934591'),
new Discord.ButtonBuilder()
.setLabel('official Discord Server')
.setStyle('Link')
.setURL('https://discord.gg/6Mcy5NpSpH')
])

interaction.reply({ embeds: [embedMsg], components: [row] })
}
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
const { PermissionsBitField } = require('discord.js');
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
slash: false,
name: 'discordjs',
description: "Displays the link for learning discord.js ",
aliases: ['discordjs', 'learndjs', 'djs'],
permissions: [PermissionsBitField.Flags.ViewChannel],
syntax: '!learndjs',
execute(client, message, args, Discord) {
data: new SlashCommandBuilder()
.setName("discordjs")
.setDescription("Displays the link for learning discord.js "),

async execute(client, interaction, Discord) {
const embedMsg = new Discord.EmbedBuilder()

.setColor('#9C27B0')

.setTitle('__Discord.js tutorial links__')

.addFields([
{ name: ' Official Discord.js Guide : ', value: 'https://discordjs.guide' },
{ name: ' Guide by Codelyon : ', value: 'https://anidiots.guide/getting-started/getting-started-long-version ' },
{ name: ' Tutorial series by Codelyon : ', value: 'https://youtube.com/playlist?list=PLbbLC0BLaGjpyzN1rg-gK4dUqbn8eJQq4 ' },
{ name: ' Tutorial series by Worn off keys : ', value: 'https://youtube.com/playlist?list=PLaxxQQak6D_fxb9_-YsmRwxfw5PH9xALe ' }
])

.setThumbnail("https://i.ibb.co/7th2xwt/images.png")

.setFooter({text: 'See github repository of the atelier bot by using !gh command. Enjoy learning Discord-js and make your own custom bot 😃 .'})

message.channel.send({ embeds: [embedMsg] });
.setFooter({ text: 'See github repository of the atelier bot by using !gh command. Enjoy learning Discord-js and make your own custom bot 😃 .' })
interaction.reply({ embeds: [embedMsg] });
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
const { PermissionsBitField } = require('discord.js');
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
slash: false,
name: 'learnjs',
aliases: ['js', 'javascript'],
permissions: [PermissionsBitField.Flags.ViewChannel],
description: "Command made for showing JavaScript tutorial links. ",
syntax: '!learnjs',
execute(client, message, args, Discord) {
data: new SlashCommandBuilder()
.setName("learnjs")
.setDescription("Sends useful links to learn javascript"),

async execute(client, interaction, Discord) {
const embed = new Discord.EmbedBuilder()
.setColor('#DDFF00')
.setThumbnail("https://i.ibb.co/5sy5y5H/javascript-logo.png")
Expand All @@ -25,9 +23,7 @@ module.exports = {
{ name: '•You might not need jQuery: ', value: 'http://youmightnotneedjquery.com/ ' },
{ name: '•CodingTrain (tutorials with examples using p5.js): ', value: ' https://www.youtube.com/user/shiffman' }
])
.setFooter({text: "This list does not contain every resource out there because the internet is huge and listing everything down is impossible."})

message.channel.send({ embeds: [embed] });

.setFooter({ text: "This list does not contain every resource out there because the internet is huge and listing everything down is impossible." })
interaction.reply({ embeds: [embed] });
}
}
17 changes: 17 additions & 0 deletions SlashCommands/Custom Commands/learnunity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
name: 'learnunity',
data: new SlashCommandBuilder()
.setName("learnunity")
.setDescription("Displays the link for learning discord.js "),

async execute(client, interaction, Discord) {
const embedMsg = new Discord.EmbedBuilder()
.setColor('#9C27B0')
.setTitle('**Learn C# basics before starting with Unity!**')
.addFields(
[{ name: "Learning the syntax of C# definitely helps when using Unity. Here are some links to get you started!", value: "https://docs.microsoft.com/en-us/dotnet/csharp/ (Microsofts 'Getting Started' Guide on C#)\nhttps://channel9.msdn.com/Series/CSharp-Fundamentals-for-Absolute-Beginners (Teaches you the C# fundamentals)\nhttps://github.com/ossu/computer-science (Not strictly C#, a general open-source education in Computer Science)\n https://www.classcentral.com/report/stanford-on-campus-courses (Publicly available Computer Science courses from Stanford)\n https://codecademy.com/learn/learn-c-sharp (Code Academy course on C#)\n https://learn.unity.com/ (Has great tutorials on using C# with Unity)" }])
.setFooter({ text: `Most programming problems come from not knowing how to use the language - if you haven’t programmed much or you’re not confident about the OOP concepts in your mind, it's useful to understand these before diving into the engine.` })
interaction.reply({ embeds: [embedMsg] });
}
}
12 changes: 12 additions & 0 deletions SlashCommands/Custom Commands/longcode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
name: 'longcode',
data: new SlashCommandBuilder()
.setName("longcode")
.setDescription("sends a link of pastemyst"),

async execute(client, interaction, Discord) {
interaction.reply('Want to send a long code? use pastemyst here is the link\nhttps://paste.myst.rs');
}
}
11 changes: 11 additions & 0 deletions SlashCommands/Custom Commands/toggler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
name: 'togglerjs',
data: new SlashCommandBuilder()
.setName("togglerjs")
.setDescription('sends the cdn link and docs links for toggler.js'),

async execute(client, interaction, Discord) {
interaction.reply("Link for Toggler CDN:\n https://cdn.jsdelivr.net/gh/Chandra-sekhar-pilla/Toggler@main/Toggler.js\n\nToggler Docs:\nhttps://the-atelier.ml/Pages/Toggler/toggler.html")
}
}
29 changes: 29 additions & 0 deletions SlashCommands/Custom Commands/topic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
name: 'topic',
data: new SlashCommandBuilder()
.setName('topic')
.setDescription('Set a topic for the channel.'),

async execute(client, interaction, Discord) {
const topics = [
'Demon slayer',
'Best Anime/manga',
'Best books you ever read',
'Best movies you ever watched',
'Best games you ever played',
'Black hole :hmmGe:',
'<https://skribbl.io/>',
'<https://ehmorris.com/lander/>',
'GPUs are great aren\'t they?',
'Minecraft is fun',
'Burritos are tasty 😋',
'Microprocessors and controllers',
'Let\'s talk about your projects',
'what\'s your device wallpaper?',
'Raspberry Pi is cool',
]
const randomIndex = Math.floor(Math.random() * topics.length);
interaction.reply({ content: topics[randomIndex] })
}
}
12 changes: 12 additions & 0 deletions SlashCommands/Event Info/ModuleInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
Module: 'Event Info',
Description: 'Module which contains commands that can be used to get info about the events.',
Commands: [
{
Name: 'event',
Description: 'Sends the info about the event.',
Syntax: '/event',
Permission: 'Everyone',
},
]
}
22 changes: 12 additions & 10 deletions commands/jam_info/events.js → SlashCommands/Event Info/events.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
const { SlashCommandBuilder } = require('discord.js')
module.exports = {
name: 'event',
description: 'sends the info about ongoing events',
aliases: ['events'],
data: new SlashCommandBuilder()
.setName('event')
.setDescription('Shows the current event'),

async execute(client, message, args, Discord) {

async execute(client, interaction, Discord) {
try {
const events = await message.guild.scheduledEvents.fetch()
let description = 'none'
if (events.size != 0) {
const events = await interaction.guild.scheduledEvents.fetch()
if (events.size !== 0) {
events.forEach(event => {
description = event.description
const description = event.description ? event.description : "Unspecified"
const embedMsg = new Discord.EmbedBuilder()
.setTitle(event.name)
.setDescription(`${description}`)
Expand All @@ -22,13 +24,13 @@ module.exports = {
{ name: 'Interested count:', value: `${event.userCount}` },
{ name: 'Hosted by:', value: `${event.creator}` }]
)
message.channel.send({ embeds: [embedMsg] })
interaction.reply({ embeds: [embedMsg] })
})
} else {
message.channel.send('There are no ongoing events.')
interaction.reply('There are no ongoing events.')
}
} catch (e) {
require(`../../handlers/ErrorHandler.js`)(client, message, Discord, e, this.name)
require(`../../handlers/ErrorHandler.js`)(client, interaction, Discord, e, this.name)
}
}
}
36 changes: 36 additions & 0 deletions SlashCommands/Fun/ModuleInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
Module: 'Fun',
Description: 'Module which contains fun commands that can be used by the user.',
Commands: [
{
Name: 'ask',
Description: 'Ask a question to the bot(like a magic 8 ball game).',
Syntax: '/ask <*question>',
Permission: 'Everyone',
},
{
Name: 'bam',
Description: 'Bam the mentioned user.',
Syntax: '/bam <@user>',
Permission: 'Everyone',
},
{
Name: 'react',
Description: 'React to the linked message with any reaction(even animated).',
Syntax: '/react <*reaction> <!message_link>',
Permission: 'Everyone',
},
{
Name: 'kill',
Description: 'Kill the mentioned user(a fun command it doesn\'t really kills someone).',
Syntax: '/kill <@user>',
Permission: 'Everyone',
},
{
Name: 'leaderboard',
Description: 'Sends the leaderboard of the server.',
Syntax: '/leaderboard',
Permission: 'Everyone',
},
]
}
Loading

0 comments on commit 823faf6

Please sign in to comment.