Skip to content

Commit

Permalink
some links were modified 馃敤
Browse files Browse the repository at this point in the history
Merge pull request #38 from yahu1031/development

* Removed API links from `.env` file and added to Code.

* Git URLs and information was modified.

* ADB files has been modified.
  • Loading branch information
yahu1031 committed Jan 30, 2021
2 parents d0d72ba + 9616cd8 commit 95dbc92
Show file tree
Hide file tree
Showing 15 changed files with 237 additions and 245 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">Contributor Covenant Code of Conduct</h1>

<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.4.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.4.2-blue.svg?cacheSeconds=2592000" />
<a href="https://github.com/yahu1031/FlutterBot#readme" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
Expand Down
14 changes: 2 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">Contribute to flutter-bot 馃</h1>

<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.4.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.4.2-blue.svg?cacheSeconds=2592000" />
<a href="https://github.com/yahu1031/FlutterBot#readme" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
Expand Down Expand Up @@ -71,17 +71,7 @@ In the root dir create a file called `.env` and add the variables in the file.
PREFIX=!
DOCSLINK=https://api.flutter.dev/flutter/
FLUTTERAPI=https://api.flutter.dev/flutter/index.json
PUBAPI=https://pub.dev/api/search?q=
MAINTAINERID=ID of the bot maintainer
FLUTTERFIRE=https://firebase.flutter.dev/docs/
PUBAPIDOCS=https://pub.dev/documentation/
```

> **Note:**
Expand All @@ -101,7 +91,7 @@ You are almost done with the setup and start running the bot
If your output in the console seems like this

```log
> flutter-bot@2.4.1 start C:\Users\Admin\Documents\Projects\FlutterBot
> flutter-bot@2.4.2 start C:\Users\Admin\Documents\Projects\FlutterBot
> node ./main.js
Data fetched from API.....鉁旓笍
Expand Down
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">Welcome to flutter-bot 馃</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.4.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.4.2-blue.svg?cacheSeconds=2592000" />
<a href="https://github.com/yahu1031/FlutterBot#readme" target="_blank">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
</a>
Expand Down Expand Up @@ -95,6 +95,8 @@ This is a [**Flutter**](https://flutter.dev) Discord bot created with [Discord.j
* remote-config
* performance

* **There are some other commands you can explaore by using `@Bot Name support`**

## Running the Bot ##

1) Clone the repository.
Expand All @@ -103,24 +105,14 @@ This is a [**Flutter**](https://flutter.dev) Discord bot created with [Discord.j
git clone https://github.com/yahu1031/FlutterBot.git
```

2) Create a `.env` file in the root folder and paste this code given below.
2) Create a `.env` file in the project root directory and paste this code given below.

```env
BOT_TOKEN=your bot token
PREFIX=!
DOCSLINK=https://api.flutter.dev/flutter/
FLUTTERAPI=https://api.flutter.dev/flutter/index.json
PUBAPI=https://pub.dev/api/search?q=
MAINTAINERID=ID of the bot maintainer
FLUTTERFIRE=https://firebase.flutter.dev/docs/
PUBAPIDOCS=https://pub.dev/documentation/
```

> **Note:**
Expand Down Expand Up @@ -168,13 +160,15 @@ This project is [MIT](https://github.com/yahu1031/FlutterBot/blob/main/LICENSE)

***Major changes***

* Added new commands `!git`, `!adb`.
* Added new help command `@FlutterBot support`.
* Added errors survey.
* Removed API links from `.env` file and added to Code.

* Git URLs and information was modified.

* ADB files has been modified.

***Minor Changes***

corrected spelling mistakes.
corrected some logics.

## Hidden Commands ##

Expand All @@ -185,7 +179,9 @@ Three commands have been hidden from the commands available.

## Fixes ##

Fixed responding to `@everyone` and `@here` tag roles.
* Fixed responding to `@everyone` and `@here` tag roles.

* Modified major links that are not propriate.

### Add this bot to your guild ###

Expand All @@ -195,6 +191,8 @@ Click on the bot to add this to your guild. [馃](https://discord.com/api/oauth

## What's-up on the next update ##

* Need to fix [#37](https://github.com/yahu1031/FlutterBot/issues/37)馃毃.

* Error command to get a solution for the common errors during flutter installation.

***
Expand Down
30 changes: 23 additions & 7 deletions commands/adb.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
const Discord = require('discord.js');

const adblink = 'https://download2032.mediafire.com/stdvudx807sg/hvevxm4zmocjnhd/15_Second_ADB_Installer_v1.5.3.zip';
const androidimg = 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Android_robot_2014.svg/151px-Android_robot_2014.svg.png';

const adbLink = 'https://dl.google.com/android/repository/platform-tools-latest-';
const androidimg = 'https://download.logo.wine/logo/Android_(operating_system)/Android_(operating_system)-Robot-Logo.wine.png';

module.exports = {
name: 'adb',
description: 'This will give you information about ADB installations.',
args: true,
execute(client, message, args) {
if (args[0] === 'help') {
return message.channel.send('**__Usage of adb command__** \n \n Use this command for adb download link for windows. \n > **__Eg__:** `!adb install`\n \nPlease do read the note of this command\'s result');
let platform;
switch (args[0]) {
case 'help':
return message.channel.send('**__Usage of adb command__** \n \n Use this command for adb download link for your prefered platform. \n > **__Eg__:** `!adb win`\n \nPlatforms to be passed with this command are `win`, `mac`, `linux`');
case 'win':
platform = 'windows';
break;
case 'mac':
platform = 'darwin';
break;
case 'linux':
platform = 'linux';
break;
default:
return message.channel.send('Sorry, No such command found. try `!adb help`');
}
else if (args[0] === 'install') {
console.log(platform);
if (platform != 'undefined') {
return message.reply(new Discord.MessageEmbed()
.setColor('#78c259')
.setAuthor('Download ADB installer')
.setThumbnail(androidimg)
.setDescription('**Android Debug Bridge**(adb) is a versatile command-line tool that lets you communicate with a device. This is recommended version to download.')
.addFields({
name: 'ADB Installer',
value: `[**Download from here**](${adblink} "Download ADB now")\n `,
}).setTimestamp().setFooter('NOTE: This is for windows only, for mac and linux use "sudo apt-get install adb".\n'));
value: `[**Download from here**](${adbLink + platform + '.zip'} "Download ADB for ${platform}")\n `,
}).setTimestamp().setFooter('NOTE: After downloading this, please extract the ZIP file and copy the folder to your root directory and add the folder to path.\n'));
}
return;
},
};
5 changes: 2 additions & 3 deletions commands/allProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
const widget = args[0].toLowerCase();
const result = [];
if (args[0] === 'help') {
message.channel.send('**__Usage of allprop command__** \n \n Use this command to know all propeties of a widget. \n > `!allprop <widget>` \n \n **__Eg__:** `!allprop hero`');
return message.channel.send('**__Usage of allprop command__** \n \n Use this command to know all propeties of a widget. \n > `!allprop <widget>` \n \n **__Eg__:** `!allprop hero`');
}
else {
try {
Expand All @@ -26,8 +26,7 @@ module.exports = {
.setThumbnail('https://cdn.discordapp.com/attachments/756903745241088011/775823132375515156/flutter.webp')
.setTitle(`All properties of ${widget}`)
.addFields(result);
message.channel.send(result.length != 0 ? response : client.notFoundMsg);
return;
return message.channel.send(result.length != 0 ? response : client.notFoundMsg);
}
catch (err) {
return (typeof allProp !== undefined) ?
Expand Down
5 changes: 2 additions & 3 deletions commands/allWidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
execute(client, message, args) {
const result = [];
if (args[0] === 'help') {
message.channel.send('**__Usage of allwidgets command__** \n \n Use this command to know all widgets which matches your search widget. \n > `!allwidgets <widget>` \n \n **__Eg__:** `!allwidgets hero`');
return message.channel.send('**__Usage of allwidgets command__** \n \n Use this command to know all widgets which matches your search widget. \n > `!allwidgets <widget>` \n \n **__Eg__:** `!allwidgets hero`');
}
else {
try {
Expand All @@ -25,8 +25,7 @@ module.exports = {
.setThumbnail('https://cdn.discordapp.com/attachments/756903745241088011/775823132375515156/flutter.webp')
.setTitle(`All results for ${allWidgets[0].name} Widget/Object`)
.addFields(result);
message.channel.send(allWidgets.length != 0 ? response : client.notFoundMsg);
return;
return message.channel.send(allWidgets.length != 0 ? response : client.notFoundMsg);
}
catch (err) {
return (typeof allWidgets !== undefined) ?
Expand Down
7 changes: 4 additions & 3 deletions commands/ask.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ module.exports = {
if (!isNaN(args[0])) {
// Checking the length of first argument is 18.
if (args[0].length === 18) {
// Delete the user's message and send the bot's message.
// ^ Uncomment this code if you give this bot a moderator/message manageable role
// message.delete();
return message.channel.send(`<@${args[0]}>, Don't ask to ask. Just ask your question and provide details, code, images, output and any error logs.`);
// Delete the user's message and send the bot's message.
// ! Uncomment this code if you give this bot a moderator/message manageable role
// ! and please remove the return in the above code
// return message.delete();
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions commands/errors.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const Discord = require('discord.js');

// const adblink = 'https://download2032.mediafire.com/stdvudx807sg/hvevxm4zmocjnhd/15_Second_ADB_Installer_v1.5.3.zip';
// const androidimg = 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Android_robot_2014.svg/151px-Android_robot_2014.svg.png';
const flutterimg = 'https://cdn.discordapp.com/attachments/756903745241088011/795994905600196648/Group_38.png';
const licenseimg = 'https://cdn.discordapp.com/attachments/756903745241088011/795996485179015198/file_type_license_1_1.png';
const sdkimg = 'https://cdn.discordapp.com/attachments/756903745241088011/796080023227334666/th-removebg-preview.png';
const dartimg = 'https://cdn.discordapp.com/attachments/756903745241088011/796081901840105572/Group_39.png';
const pluginimg = 'https://cdn.discordapp.com/attachments/756903745241088011/796082433496973322/Group_40.png';

module.exports = {
Expand Down
Loading

0 comments on commit 95dbc92

Please sign in to comment.