-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: canned responses, environment file
Signed-off-by: BluLightShow <[email protected]>
- Loading branch information
1 parent
1793dd3
commit 44efccf
Showing
9 changed files
with
116 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const { Command } = require('discord-akairo') | ||
const config = require('../config.json') | ||
const fs = require('fs') | ||
const { MessageEmbed } = require('discord.js') | ||
const { embed } = require('../bot') | ||
|
||
class TagCommand extends Command { | ||
constructor() { | ||
super('tag', { | ||
aliases: ['tag', 'qr', 'res'], | ||
channel: 'guild', | ||
description: 'Send a canned response in the channel.', | ||
args: [ | ||
{ | ||
id: 'tagAlias', | ||
type: 'string' | ||
} | ||
] | ||
}) | ||
} | ||
|
||
exec(message, args) { | ||
var files = fs.readdirSync('./tags') | ||
files.forEach(file => { | ||
if (file.endsWith('.json') && (file !== 'template.json')) { | ||
var tagFile = JSON.parse(fs.readFileSync(`./tags/${file}`)) | ||
if (tagFile.aliases.includes(args.tagAlias)) { | ||
var tagEmbed = new MessageEmbed(embed) | ||
.setTitle(tagFile.title) | ||
|
||
if (tagFile.image) tagEmbed.setImage(tagFile.image) | ||
tagFile.fields.forEach(field => { | ||
tagEmbed.addField(field.name, field.value, false) | ||
}) | ||
|
||
message.channel.send(tagEmbed) | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
module.exports = TagCommand |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"title": "Solving Avrdude Communication Error (try in order)", | ||
"aliases": ["avrdude"], | ||
"fields": [ | ||
{ | ||
"name": "1.", | ||
"value": "If serial monitor is open, close it." | ||
}, | ||
{ | ||
"name": "2.", | ||
"value": "Try changing the port you are connecting and selecting it from software, you can find it in tools -> port." | ||
}, | ||
{ | ||
"name": "3.", | ||
"value": "Check if the power led on your board lights up. If it's on unplug and re-plug your board. Now check for blinking leds. If only power or no led lights up ask for further assistance. (not for all boards)" | ||
}, | ||
{ | ||
"name": "4.", | ||
"value": "Try using the old bootloader. Go to tools -> processor and select 328p(old bootloader). If you are not on Nano, you can skip this step and try it after doing option 5. In that case select your board as nano before you try(make sure you have a 328p chip board like uno)." | ||
}, | ||
{ | ||
"name": "5.", | ||
"value": "Try pressing reset button on arduino, if when you reset the onboard led doesn't blink, you probably have a broken bootloader, you can check [this tutorial](https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader) for how to burn bootloader." | ||
}, | ||
{ | ||
"name": "6.", | ||
"value": "If there's anything connected to Tx and Rx pins, try removing everything attached to them them." | ||
}, | ||
{ | ||
"name": "7.", | ||
"value": "This might just be a communication problem or your computer getting confused so try restarting your computer." | ||
}, | ||
{ | ||
"name": "8.", | ||
"value": "Check your drivers, sometimes just reinstalling them works. If you are using a clone board you might have CH340 communication chip, which isn't supported for Uno. You can check that by looking at your board and checking a chip's name (not the big one). [Click here](https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all) for installing CH340 chip. If you don't have CH340 chip you can try installing drivers from Windows device manager." | ||
}, | ||
{ | ||
"name": "9.", | ||
"value": "You can try checking [this website](https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/windows---in-depth) for your drivers." | ||
}, | ||
{ | ||
"name": "10.", | ||
"value": "Last thing might be Arduino IDE's problem. If you think that's the case try reinstalling Arduino IDE." | ||
} | ||
], | ||
"image": "" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"title": "", | ||
"aliases": [], | ||
"fields": [ | ||
{ | ||
"name": "", | ||
"value": "" | ||
} | ||
], | ||
"image": "" | ||
} |