mirror of
https://github.com/revanced/revanced-discord-bot.git
synced 2025-05-29 21:30:14 +02:00
fix: correctly find slice_end
This commit is contained in:
parent
f754cd3107
commit
7e2db945a0
@ -21,7 +21,7 @@ pub async fn handle_code_url(ctx: &serenity::Context, new_message: &serenity::Me
|
|||||||
|
|
||||||
if let Some(end) = new_slice
|
if let Some(end) = new_slice
|
||||||
.find(' ')
|
.find(' ')
|
||||||
.or_else(|| new_slice.find('\n'))
|
.or(Some(new_slice.len()))
|
||||||
.map(|slice_end| start + slice_end)
|
.map(|slice_end| start + slice_end)
|
||||||
{
|
{
|
||||||
debug!("HTTP url end: {}", end);
|
debug!("HTTP url end: {}", end);
|
||||||
@ -72,7 +72,7 @@ pub async fn handle_code_url(ctx: &serenity::Context, new_message: &serenity::Me
|
|||||||
for code_preview in code_previews {
|
for code_preview in code_previews {
|
||||||
message = message.add_embed(|e| {
|
message = message.add_embed(|e| {
|
||||||
let mut e = e
|
let mut e = e
|
||||||
.title("Code preview")
|
.title("Source code")
|
||||||
.url(code_preview.code.original_code_url)
|
.url(code_preview.code.original_code_url)
|
||||||
.color(configuration.general.embed_color)
|
.color(configuration.general.embed_color)
|
||||||
.field(
|
.field(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user