-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ds-discord test #5
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Masih ada beberapa hal yang harus diubah.
Selain itu file maju.html
harus di hapus juga.
if message.channel.name == 'general': | ||
if user_message.lower() == 'hello': | ||
await message.channel.send(f'Hello {username}!') | ||
return | ||
elif user_message.lower() == 'yourname': | ||
await message.channel.send(f'MY Name is DS-DISCORDBOT#8284, {username}!') | ||
return | ||
elif user_message.lower() == 'bye': | ||
await message.channel.send(f'see you later {username}!') | ||
return | ||
elif user_message.lower() == '!random': | ||
response = f'This is your random number: {random.randrange(1000000)}' | ||
await message.channel.send(response) | ||
return | ||
if user_message.lower() == '!anywhere': | ||
await message.channel.send('This can be used anywhere!') | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mungkin bisa tambahkan fitur untuk kelolah isi message
Karena pake discord.ext
bisa ubah ke bentuk fungsi, mengikuti tutorial ini
client.run('OTM0NDM2NzMwNzcyMjkxNTg0.YewEBQ.Y-mKAQVp63S2wtJdJymPmthJtJw') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client.run('OTM0NDM2NzMwNzcyMjkxNTg0.YewEBQ.Y-mKAQVp63S2wtJdJymPmthJtJw') | |
client.run(BOT_TOKEN) |
Gunakan lib dotenv
untuk BOT_TOKENnya.
Siap ka glen, beta baru liat soalnya di sini lampu baru manyala kaka,,
Pada tanggal Sen, 14 Feb 2022 pukul 06.41 Stevarth ***@***.***>
menulis:
… ***@***.**** requested changes on this pull request.
Masih ada beberapa hal yang harus diubah.
Selain itu file maju.html harus di hapus juga.
------------------------------
In .vscode/launch.json
<#5 (comment)>:
> +{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "g++.exe - Build and debug active file",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
+ "args": [],
+ "stopAtEntry": false,
+ "cwd": "${fileDirname}",
+ "environment": [],
+ "externalConsole": false,
+ "MIMode": "gdb",
+ "miDebuggerPath": "D:\\G++Install\\mingw32\\bin\\gdb.exe",
+ "setupCommands": [
+ {
+ "description": "Enable pretty-printing for gdb",
+ "text": "-enable-pretty-printing",
+ "ignoreFailures": true
+ }
+ ],
+ "preLaunchTask": "C/C++: g++.exe build active file"
+ }
+ ]
+}
File ini harus karena tasknya untuk C++
------------------------------
In .vscode/workspace.code-workspace
<#5 (comment)>:
> +{
+ "folders": [
+ {
+ "path": ".."
+ },
+ {
+ "path": "D:\\XamppInstall\\htdocs\\PortalProject\\Web Jemaat GPM Makariki\\Cosmix Free Website Template - Free-CSS.com\\cosmix"
+ }
+ ],
+ "settings": {}
+}
File ini juga harus di hapus, atau tambah .vscode/ ke .gitignore
------------------------------
In main.py
<#5 (comment)>:
> +
+bot = commands.Bot(command_prefix=">>>")
⬇️ Suggested change
-
-bot = commands.Bot(command_prefix=">>>")
+BOT_PREFIX=">>>"
+bot = commands.Bot(command_prefix=BOT_PREFIX)
------------------------------
In main.py
<#5 (comment)>:
> + if message.channel.name == 'general':
+ if user_message.lower() == 'hello':
+ await message.channel.send(f'Hello {username}!')
+ return
+ elif user_message.lower() == 'yourname':
+ await message.channel.send(f'MY Name is DS-DISCORDBOT#8284, {username}!')
+ return
+ elif user_message.lower() == 'bye':
+ await message.channel.send(f'see you later {username}!')
+ return
+ elif user_message.lower() == '!random':
+ response = f'This is your random number: {random.randrange(1000000)}'
+ await message.channel.send(response)
+ return
+ if user_message.lower() == '!anywhere':
+ await message.channel.send('This can be used anywhere!')
+ return
Mungkin bisa tambahkan fitur untuk kelolah isi message
Karena pake discord.ext bisa ubah ke bentuk fungsi, mengikuti tutorial ini
<https://discordpy.readthedocs.io/en/stable/ext/commands/commands.html>
------------------------------
In main.py
<#5 (comment)>:
> + elif user_message.lower() == '!random':
+ response = f'This is your random number: {random.randrange(1000000)}'
+ await message.channel.send(response)
+ return
+ if user_message.lower() == '!anywhere':
+ await message.channel.send('This can be used anywhere!')
+ return
Seharusnya tidak perlu pake tanda ! diawal teks karena akan di atur pada
line 9
------------------------------
In main.py
<#5 (comment)>:
> +client.run('OTM0NDM2NzMwNzcyMjkxNTg0.YewEBQ.Y-mKAQVp63S2wtJdJymPmthJtJw')
+
⬇️ Suggested change
-client.run('OTM0NDM2NzMwNzcyMjkxNTg0.YewEBQ.Y-mKAQVp63S2wtJdJymPmthJtJw')
-
+client.run(BOT_TOKEN)
Gunakan lib dotenv untuk BOT_TOKENnya.
—
Reply to this email directly, view it on GitHub
<#5 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUK5743Q3EU47X4I43SQ6KLU3A6T5ANCNFSM5N7V7LDQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
ds-discordbot.zip